mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-23 16:59:16 +00:00
Updated Upstream (Paper 1.20.6)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@abc49bf Begin update to 1.20.5 PaperMC/Paper@f2c45ed do some work PaperMC/Paper@00c14f2 Move logging patches after adventure PaperMC/Paper@ef057bb work on Adventure patch PaperMC/Paper@380c4d2 Add plugin remapping patches PaperMC/Paper@7cdf804 Work PaperMC/Paper@dd6ce09 Fix reflection diff and order wrt commodore diff PaperMC/Paper@598a1cb Apply shadow removal patch PaperMC/Paper@ffccfd5 Apply timings PaperMC/Paper@eb41348 33 PaperMC/Paper@9cac5b6 Fix continueServerUpdate with 2-line subjects PaperMC/Paper@2eeed9e 41 PaperMC/Paper@d07c487 Don't use defaultToolchain method for run tasks PaperMC/Paper@f2350fe Set mercury sourceCompat PaperMC/Paper@5cfd92b Fix api compile PaperMC/Paper@862d004 work on some API stuff PaperMC/Paper@d6a3c0c fix 2 of our javadoc errors PaperMC/Paper@487555b update PaperMC/Paper@0225537 Update upstream PaperMC/Paper@906f906 Patches! PaperMC/Paper@8244815 221 PaperMC/Paper@309ebc1 253 PaperMC/Paper@1d7d7e9 301 PaperMC/Paper@9079c90 354 PaperMC/Paper@cc46148 405 PaperMC/Paper@5be858e Patches! PaperMC/Paper@2d9d0d8 Patches! PaperMC/Paper@a403a8d Patches!!!!!!! PaperMC/Paper@21afc0a Patches!!!!!!! PaperMC/Paper@1de0dc8 666 plus 1 PaperMC/Paper@4e654f2 More patch work PaperMC/Paper@e832328 Check for existing am session before running continueServerUpdate PaperMC/Paper@fc5c0da 683 PaperMC/Paper@90095cd 694 PaperMC/Paper@71ae391 more work (721) PaperMC/Paper@22227cc more more work (757) PaperMC/Paper@4d9e824 more more work (806) PaperMC/Paper@9617829 Restore original formatting for MC-252817 patch PaperMC/Paper@0518559 Update reflection rewriter to 0.0.1 release PaperMC/Paper@e0a245d Patches!!!!!!! PaperMC/Paper@1104431 955 PaperMC/Paper@1df7e21 Apply more API-implementing patches PaperMC/Paper@b733809 Drop conduit api patch (upstream implemented same api with same method signatures) PaperMC/Paper@c95db4f adventure 4.17.0-SNAPSHOT PaperMC/Paper@bb1351c some work on adventure PaperMC/Paper@1444b36 work on adventure PaperMC/Paper@ce0e78c compile fixes PaperMC/Paper@25f7c68 compile fixes PaperMC/Paper@690b1cd compile fixes PaperMC/Paper@b673721 compile fixes PaperMC/Paper@6a87d14 dataconverter PaperMC/Paper@ec9f7e3 starlight PaperMC/Paper@e9eec78 chunk system PaperMC/Paper@f6ea373 Patches PaperMC/Paper@ec4ada8 Apply and move up non-optimization patches PaperMC/Paper@c9907c6 More patches PaperMC/Paper@2debcaf More more patches, including hopper optimization patch PaperMC/Paper@6da0d8c (Almost) all patches applied PaperMC/Paper@345b5c1 Patches!!!!!!! (we are done) PaperMC/Paper@4590038 Fix properly resend patches PaperMC/Paper@457e2c8 pass more stuff PaperMC/Paper@b8da9ac item meta patch work PaperMC/Paper@ccf158a update smithing recipe copy data components API PaperMC/Paper@653f043 readd fix bee aging patch PaperMC/Paper@bab31b6 Update Enchantment damage increase API PaperMC/Paper@f4c7639 Un-jankify root user detection PaperMC/Paper@9c58056 Some more compilation fixes PaperMC/Paper@b984f66 Missing FQN in CraftPotionBrewer getter PaperMC/Paper@768befe Remove patch renaming scripts PaperMC/Paper@04a25c2 Fix WorldCreator#keepSpawnLoaded PaperMC/Paper@820f999 Fixes for cb pkg ver PaperMC/Paper@ca9001a compile fixes PaperMC/Paper@d01f6b2 Fix more compile issues PaperMC/Paper@8d3759d More more compile fixes PaperMC/Paper@ed79038 More compile fixes PaperMC/Paper@2641c02 Updated Upstream (Bukkit/CraftBukkit) PaperMC/Paper@68aea43 Fixup damage source change PaperMC/Paper@3062eb2 address my own comments PaperMC/Paper@e85e1ec fixup sus effect entry patches PaperMC/Paper@10e6143 fixup adventure's book meta handling PaperMC/Paper@a244281 Replace VanillaGradle use and update generated API PaperMC/Paper@31ad90b some more compile fixes PaperMC/Paper@d2ef062 generator fix PaperMC/Paper@7c6411b compile fixes PaperMC/Paper@867eb90 compile fixes PaperMC/Paper@62b96c5 compile fixes PaperMC/Paper@c5c2a5f hunk system fixes PaperMC/Paper@bcdf1f9 fixup loom pattern select event patch PaperMC/Paper@43d110e fix issue with item default attribute API PaperMC/Paper@2997fd6 plugin manager updates PaperMC/Paper@7e9da43 support patch versions in api-version PaperMC/Paper@813cfbf Fix compile issues PaperMC/Paper@478a971 Fix light setting in protochunk PaperMC/Paper@8b28f9f Fix accumulated total ticking chunks not being updated PaperMC/Paper@00dac83 Drop old decompile fix PaperMC/Paper@f6fae41 fix chat_type issue PaperMC/Paper@cc81668 fix some issues on the todo list PaperMC/Paper@44e68c3 fix some more issues PaperMC/Paper@1bc278b Update patched spigot decompiler to fix inconsistency based on processing order PaperMC/Paper@19ac9d4 remove no longer needed patches and fix tests PaperMC/Paper@e856d17 Update paper plugin check in PluginRemapper PaperMC/Paper@882ea0a fix adventure translations PaperMC/Paper@4c53ace fix exact choice recipes PaperMC/Paper@464cc81 fix custom potion mixes PaperMC/Paper@ff77f82 paperweight 1.6.0 PaperMC/Paper@6a4974b Remove shadow from build classpath PaperMC/Paper@c38f96b deprecate our ItemRarity API PaperMC/Paper@ba8512a fix javadocs for SpawnerEntry$Equipment API PaperMC/Paper@f1fc1b3 readd old UUID format patch PaperMC/Paper@5485043 Don't tell people to build the reobf jar PaperMC/Paper@2f19f0f fix enchantment order issue PaperMC/Paper@80bd015 fix adventure converters not using RegistryOps PaperMC/Paper@68e23db add back missing call to profile fill events PaperMC/Paper@9bac389 more fixes PaperMC/Paper@81f4405 add back hunk to async SavedData IO PaperMC/Paper@91b5de6 bunch of fixes and improvements PaperMC/Paper@f85d423 improve dumpitem and pgive commands PaperMC/Paper@5731f34 Restore Handle Large Packets Disconnecting Client Patch PaperMC/Paper@f037f08 Unify plugin remapping debug flags PaperMC/Paper@c82766d fix item flags PaperMC/Paper@f933c35 Update DataConverter to 1.20.6-rc1 PaperMC/Paper@55b1a87 fix PotionEffectType#getEffectAttributes PaperMC/Paper@0b1b1fe fix helmet damage reduction inconsistencies PaperMC/Paper@e2552ee Start cleaning up plugin remapping patches PaperMC/Paper@711dbd7 Bump adventure ansi serializer PaperMC/Paper@af97400 update generator PaperMC/Paper@b7e148a Move obfhelper/stack deobf diff into original patch PaperMC/Paper@a390119 Move cb version definition to gradle patch PaperMC/Paper@20af7a7 remove funny diff PaperMC/Paper@b3ea907 more ItemFlag fixes PaperMC/Paper@53d8edd properly check for experimental stuff in generator PaperMC/Paper@a771940 Revert to vanilla handling of LivingEntity#actuallyHurt (#10463) PaperMC/Paper@06cae13 Update jdk version and distribution in actions PaperMC/Paper@dd571d8 Fix bad diff in build gradle file PaperMC/Paper@d02bb81 proper migration to gamerules for keep spawn loaded distance PaperMC/Paper@aeb3f37 update paperweight to 1.6.1 PaperMC/Paper@75c22d5 Bump tiny-remapper PaperMC/Paper@8454786 Bump tiny-remapper (real) PaperMC/Paper@d99d84a Temporarily comment out adventure jd links PaperMC/Paper@83767f9 Use JetBrains runtime for run tasks PaperMC/Paper@4ad6022 improve checking handled tags in itemmeta (#9470) PaperMC/Paper@8ce62b3 Fix issue with hopppers PaperMC/Paper@7e3d5b5 bump paperweight to 1.6.2 to fix spurious build failure from scanJar OOM PaperMC/Paper@d964c15 fix last test issue PaperMC/Paper@3e90a19 Updated Upstream (Bukkit/CraftBukkit) PaperMC/Paper@d93c6f9 remove calls to DoNotUse methods PaperMC/Paper@f187fd6 Only scan `org.bukkit.craftbukkit.inventory` in `MetaHandledTagsTest` PaperMC/Paper@a3c4dc9 Fix the incorrect codec usage in the Style convert (#10465) PaperMC/Paper@e16263c Fix firework meta NPE PaperMC/Paper@306b203 more fixes for ItemMeta relating to components PaperMC/Paper@1a03cc9 Fix test compilation PaperMC/Paper@6e31f38 Fix book meta lacking resolved tag from older versions (Fixes #10470) PaperMC/Paper@37b3891 Fix another missing book meta tag PaperMC/Paper@c4a1cd1 Fix issue with empty lists in adventure predicates PaperMC/Paper@9d6e7e3 Don't hard fail on plugin remap error PaperMC/Paper@4491ac0 respect hard list size limits in ItemMeta PaperMC/Paper@aed7dca Fix overly strong name validation in player heads PaperMC/Paper@0f4d328 final missing validation for data components PaperMC/Paper@52ff3b7 Add itemName components (Resolves #10467) (#10471) PaperMC/Paper@ba673a3 [ci skip] Feature requests are now in GitHub Discussions (#10606) PaperMC/Paper@0f3e324 [ci skip] Fix discussion template file name (#10607) PaperMC/Paper@82a8012 [ci skip] adjust projects workflow for label changes PaperMC/Paper@61c9c07 Fix CraftMetaBlockState adding extra tags PaperMC/Paper@7f2d531 Rewrite reflection in library loader jars (#10608) PaperMC/Paper@05308fc Remap plugin libraries with namespace set to spigot (#10610) PaperMC/Paper@69a971a Reset component prototype on itemtype change PaperMC/Paper@f9397e1 Fix incorrect Commodore mapping of sweeping enchant PaperMC/Paper@8f7ac62 Validate manifest provided mapping namespace (#10612) PaperMC/Paper@fbe3c00 [ci skip] update projects workflow configuration PaperMC/Paper@44ee092 1.20.6 (#10623) PaperMC/Paper@812ccb9 fix spawnChunkRadius gamerule resetting PaperMC/Paper@25e44bc fix dumpitem command nbt format PaperMC/Paper@3fdd094 Fix sealed package check in BytecodeModifyingURLClassLoader (#10627) PaperMC/Paper@937a67a Add initial size cap to component map PaperMC/Paper@4ea67ab [ci skip] Remove trailing comma in projects action PaperMC/Paper@8c058f8 Update paperweight to 1.6.3 (#10626) PaperMC/Paper@fa6013d Fixes beds not exploding in the nether PaperMC/Paper@3e0eb4a Updated Upstream (CraftBukkit) (#10624) PaperMC/Paper@4cfd9e2 Expose canReach to mob pathfinding API (#10636) PaperMC/Paper@b8c454c Add damage check for mending (#10631) PaperMC/Paper@310b47b Update Java version references, add note on var usages PaperMC/Paper@faa7aa2 Add GameMode#isInvulnerable (#10633) PaperMC/Paper@18c201b Add EquipmentSlot#getOppositeHand (#10632) PaperMC/Paper@544ce20 Expose #hasColor to leather armor (#10638) PaperMC/Paper@59fe7cc default save-empty-scoreboard-teams to vanilla PaperMC/Paper@0db72ac Fix can_place_on conversion and size check for item containers PaperMC/Paper@156675c Fix lodestone compass target conversion PaperMC/Paper@5632210 add RegistryAccess for managing registries (#10154) PaperMC/Paper@6fcca46 Add missing step in V3818 PaperMC/Paper@7401313 fix shear drops for wolf and bogged PaperMC/Paper@7ae2c67 Keep components using single items in creative (#10664) PaperMC/Paper@b13c7db Add missing experimental field and annotations (#10653) PaperMC/Paper@9d8d38d Updated Upstream (CraftBukkit) (#10646) PaperMC/Paper@0e43d3c Added API to get player's proxy address (#10400) PaperMC/Paper@54c5ecb Add missing SpigotConfig logCommands check (#10659) PaperMC/Paper@816ea9e [ci skip] Update old particle reference in javadoc (#10652) PaperMC/Paper@716dfd8 Fix EntityLoadCrossbowEvent (#10645) PaperMC/Paper@21d91ce Prevent profile lookups when unnecessary (#10651) PaperMC/Paper@2a6a5fe Add a way to check whether the chest is blocked (#10635) PaperMC/Paper@ac3a547 Fix BlockStateMeta (#10647)
This commit is contained in:
@@ -2,8 +2,7 @@ import io.papermc.paperweight.util.constants.PAPERCLIP_CONFIG
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("io.papermc.paperweight.patcher") version "1.6.3"
|
||||||
id("io.papermc.paperweight.patcher") version "1.5.15"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -14,7 +13,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
|
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
|
||||||
decompiler("org.vineflower:vineflower:1.10.1")
|
decompiler("org.vineflower:vineflower:1.10.1")
|
||||||
paperclip("io.papermc:paperclip:3.0.3")
|
paperclip("io.papermc:paperclip:3.0.3")
|
||||||
}
|
}
|
||||||
@@ -23,12 +22,12 @@ subprojects {
|
|||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain { languageVersion.set(JavaLanguageVersion.of(17)) }
|
toolchain { languageVersion.set(JavaLanguageVersion.of(21)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<JavaCompile>().configureEach {
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
options.release.set(17)
|
options.release.set(21)
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -40,6 +39,7 @@ subprojects {
|
|||||||
maven("https://repo.md-5.net/content/repositories/releases/")
|
maven("https://repo.md-5.net/content/repositories/releases/")
|
||||||
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
|
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
|
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") // TODO - Adventure snapshot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
group=me.samsuik.sakura
|
group=me.samsuik.sakura
|
||||||
version=1.20.4-R0.1-SNAPSHOT
|
version=1.20.6-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.20.4
|
mcVersion=1.20.6
|
||||||
paperRef=f4c7d373e4a1aff23539fe099745bf29a28559b9
|
paperRef=ac3a5471c8dcdc1d0431025781da1d524895c47a
|
||||||
|
|
||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Customise Version Command
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index ca27559cf4aa1c2e44fdca2022e213b1b1c80f4e..958dfcccc79aeeb5d457ee2fd0d5db05d859366a 100644
|
index 5d1b55fdbcbe63f6b42b694d05211a3cc691a09d..7b014bcdc0a4b02f3e0852c46a9965c592913883 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -129,6 +129,20 @@ public final class Bukkit {
|
@@ -131,6 +131,20 @@ public final class Bukkit {
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,10 +153,10 @@ index 0000000000000000000000000000000000000000..0483f5a19ff3d4e5e6528c3e4be549fd
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index 254a02ddb5dc867c9dd6c2086791f7ab94247fd3..0528c0ab4c059575e7cc00e5e1cd52ebacb95e67 100644
|
index 6c327a07bf8a6aa11a2d7dad12b2830acc539484..078c379e17050b747163b08d7f1fcc2290a6f513 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -56,6 +56,15 @@ import org.jetbrains.annotations.Nullable;
|
@@ -58,6 +58,15 @@ import org.jetbrains.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient { // Paper
|
public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient { // Paper
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Branding changes
|
|||||||
From ForkPaper.
|
From ForkPaper.
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index bcfe59b6efb628ee1e7f9d60667360d4d885fb6a..08745682d6543ce8f06f5a9f94016e2f04b89177 100644
|
index 5d448d8a7cf6626a11791f30ad52baf41a099272..8096e25f2928ab1765dab3b393dd9dda01f1aad5 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
@@ -12,8 +12,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
val alsoShade: Configuration by configurations.creating
|
val alsoShade: Configuration by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -17,14 +17,14 @@ index bcfe59b6efb628ee1e7f9d60667360d4d885fb6a..08745682d6543ce8f06f5a9f94016e2f
|
|||||||
- implementation(project(":paper-mojangapi"))
|
- implementation(project(":paper-mojangapi"))
|
||||||
+ // Sakura start
|
+ // Sakura start
|
||||||
+ implementation(project(":sakura-api"))
|
+ implementation(project(":sakura-api"))
|
||||||
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
|
+ implementation("io.papermc.paper:paper-mojangapi:1.20.6-R0.1-SNAPSHOT") {
|
||||||
+ exclude("io.papermc.paper", "paper-api")
|
+ exclude("io.papermc.paper", "paper-api")
|
||||||
+ }
|
+ }
|
||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
// Paper start
|
// Paper start
|
||||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
@@ -71,7 +75,7 @@ tasks.jar {
|
@@ -79,7 +83,7 @@ tasks.jar {
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
"Implementation-Title" to "CraftBukkit",
|
"Implementation-Title" to "CraftBukkit",
|
||||||
@@ -34,10 +34,10 @@ index bcfe59b6efb628ee1e7f9d60667360d4d885fb6a..08745682d6543ce8f06f5a9f94016e2f
|
|||||||
"Specification-Title" to "Bukkit",
|
"Specification-Title" to "Bukkit",
|
||||||
"Specification-Version" to project.version,
|
"Specification-Version" to project.version,
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 2dc07e5ef249636e85ad9c78e3729e9e066a8fe8..e4ef4306d93cb81868468b78b98fc4c6b7633103 100644
|
index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..db709ec011e2ad002c7b08cb7dd8ed8b84aeee37 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1865,7 +1865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1924,7 +1924,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@@ -47,10 +47,10 @@ index 2dc07e5ef249636e85ad9c78e3729e9e066a8fe8..e4ef4306d93cb81868468b78b98fc4c6
|
|||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
public SystemReport fillSystemReport(SystemReport details) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index c490a29bcf7410bc54959ee71375605964379ed5..af2c7758373ca3ecd53ca185f6730c284e964b26 100644
|
index 57db399bc1d3b6b015740b059987bc8d9bcc3101..6d01828434b8dce0359fe2a37b450e0aae916e3b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
|
@@ -268,7 +268,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
import javax.annotation.Nonnull; // Paper
|
import javax.annotation.Nonnull; // Paper
|
||||||
|
|
||||||
public final class CraftServer implements Server {
|
public final class CraftServer implements Server {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Sakura Configuration Files
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||||
index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..df0da18b38f382a452b1e1489a4f2c332f2f1311 100644
|
index 96142deb42700f888ea08689ab62c27ef2b881fd..87f4320a29506417d29e83b06245a3d4edcbb383 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
|
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||||
@@ -93,7 +93,7 @@ public abstract class Configurations<G, W> {
|
@@ -96,7 +96,7 @@ public abstract class Configurations<G, W> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..df0da18b38f382a452b1e1489a4f2c33
|
|||||||
return node -> {
|
return node -> {
|
||||||
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
|
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
|
||||||
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
|
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
|
||||||
@@ -227,7 +227,7 @@ public abstract class Configurations<G, W> {
|
@@ -231,7 +231,7 @@ public abstract class Configurations<G, W> {
|
||||||
.path(worldConfigFile)
|
.path(worldConfigFile)
|
||||||
.build();
|
.build();
|
||||||
final ConfigurationNode worldNode = worldLoader.load();
|
final ConfigurationNode worldNode = worldLoader.load();
|
||||||
@@ -27,7 +27,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..df0da18b38f382a452b1e1489a4f2c33
|
|||||||
} else {
|
} else {
|
||||||
this.verifyWorldConfigVersion(contextMap, worldNode);
|
this.verifyWorldConfigVersion(contextMap, worldNode);
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||||
index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..9ea2e60095526e63a1f4a0087cfd59067bb92c7e 100644
|
index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..d43267fe2718b6016fe44c3bbf8196f8efc49ef1 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||||
@@ -457,7 +457,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
@@ -457,7 +457,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||||
@@ -388,10 +388,10 @@ index 0000000000000000000000000000000000000000..5296d4e0a1041932e36562f42fbf3e1d
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/me/samsuik/sakura/configuration/SakuraConfigurations.java b/src/main/java/me/samsuik/sakura/configuration/SakuraConfigurations.java
|
diff --git a/src/main/java/me/samsuik/sakura/configuration/SakuraConfigurations.java b/src/main/java/me/samsuik/sakura/configuration/SakuraConfigurations.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..04dc81634277d05894076a2cafde60ca35e1886e
|
index 0000000000000000000000000000000000000000..24a7b677f4c45375739c01546f08cabc44c56ba2
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/samsuik/sakura/configuration/SakuraConfigurations.java
|
+++ b/src/main/java/me/samsuik/sakura/configuration/SakuraConfigurations.java
|
||||||
@@ -0,0 +1,251 @@
|
@@ -0,0 +1,252 @@
|
||||||
+package me.samsuik.sakura.configuration;
|
+package me.samsuik.sakura.configuration;
|
||||||
+
|
+
|
||||||
+import com.google.common.collect.Table;
|
+import com.google.common.collect.Table;
|
||||||
@@ -426,6 +426,7 @@ index 0000000000000000000000000000000000000000..04dc81634277d05894076a2cafde60ca
|
|||||||
+import net.minecraft.world.item.Item;
|
+import net.minecraft.world.item.Item;
|
||||||
+import net.minecraft.world.level.block.Block;
|
+import net.minecraft.world.level.block.Block;
|
||||||
+import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
+import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||||
|
+import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
+import org.slf4j.Logger;
|
+import org.slf4j.Logger;
|
||||||
+import org.spongepowered.configurate.ConfigurateException;
|
+import org.spongepowered.configurate.ConfigurateException;
|
||||||
+import org.spongepowered.configurate.ConfigurationNode;
|
+import org.spongepowered.configurate.ConfigurationNode;
|
||||||
@@ -575,7 +576,7 @@ index 0000000000000000000000000000000000000000..04dc81634277d05894076a2cafde60ca
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node) throws ConfigurateException {
|
+ protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node, final @Nullable ConfigurationNode defaultsNode) throws ConfigurateException {
|
||||||
+ final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
|
+ final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
|
||||||
+ V2_VerticalKnockbackUseDefault.apply(versionedBuilder);
|
+ V2_VerticalKnockbackUseDefault.apply(versionedBuilder);
|
||||||
+ V3_RenameKnockback.apply(versionedBuilder);
|
+ V3_RenameKnockback.apply(versionedBuilder);
|
||||||
@@ -932,10 +933,10 @@ index 0000000000000000000000000000000000000000..4024f9738e039ffffd560a07a2210f75
|
|||||||
+public record DurableMaterial(int durability, float resistance) {
|
+public record DurableMaterial(int durability, float resistance) {
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index e4ef4306d93cb81868468b78b98fc4c6b7633103..ca9013a7141a4e6b5b45651961dd977929a0756b 100644
|
index db709ec011e2ad002c7b08cb7dd8ed8b84aeee37..91d3224cb30f62008a116fa4f913b06928d43c0a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -313,6 +313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public final double[] recentTps = new double[ 3 ];
|
public final double[] recentTps = new double[ 3 ];
|
||||||
// Spigot end
|
// Spigot end
|
||||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
|
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
|
||||||
@@ -943,7 +944,7 @@ index e4ef4306d93cb81868468b78b98fc4c6b7633103..ca9013a7141a4e6b5b45651961dd9779
|
|||||||
public static long currentTickLong = 0L; // Paper - track current tick as a long
|
public static long currentTickLong = 0L; // Paper - track current tick as a long
|
||||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
@@ -412,6 +413,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -422,6 +423,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
||||||
@@ -955,10 +956,10 @@ index e4ef4306d93cb81868468b78b98fc4c6b7633103..ca9013a7141a4e6b5b45651961dd9779
|
|||||||
|
|
||||||
private void readScoreboard(DimensionDataStorage persistentStateManager) {
|
private void readScoreboard(DimensionDataStorage persistentStateManager) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 68d268b6fff126e8645b6deec3fb549ea2286b77..66eb8a462b472003333bb0af897e7650f5b63aa4 100644
|
index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..4af33141f6c9169a016978cf74dc2d33ebd011e8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -221,6 +221,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -234,6 +234,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider
|
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider
|
||||||
@@ -971,23 +972,23 @@ index 68d268b6fff126e8645b6deec3fb549ea2286b77..66eb8a462b472003333bb0af897e7650
|
|||||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 502bdc726b7890b00ee36871d905dea44e8719e3..ed7b9d9a3856cf36b64e629a86c2e9bdac381eb3 100644
|
index 0981d440d0dbfe4df668d1f3f1b5706a93bc4434..cffdb530be035d177ccfd13a9e560c544f3acaac 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -692,7 +692,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -697,7 +697,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||||
|
|
||||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||||
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
|
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
|
||||||
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), () -> minecraftserver.sakuraConfigurations.createWorldConfig(me.samsuik.sakura.configuration.SakuraConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), minecraftserver.registryAccess())), executor); // Sakura // Paper - create paper world configs; Async-Anti-Xray: Pass executor
|
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), () -> minecraftserver.sakuraConfigurations.createWorldConfig(me.samsuik.sakura.configuration.SakuraConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), minecraftserver.registryAccess())), executor); // Sakura // Paper - create paper world configs; Async-Anti-Xray: Pass executor
|
||||||
this.pvpMode = minecraftserver.isPvpAllowed();
|
this.pvpMode = minecraftserver.isPvpAllowed();
|
||||||
this.convertable = convertable_conversionsession;
|
this.convertable = convertable_conversionsession;
|
||||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
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
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index ca89d1593bf1b46c79a882db528cbca1359dc9d4..a0a68ff09689d457f3c6e17f3e5d6d595f84684a 100644
|
index b4ef3ad2c17168085372f1fe46809f02d9dfe74a..3a30562a4ec500eade01b646aacbdfbba39f547b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -171,6 +171,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -168,6 +168,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return this.paperConfig;
|
return this.paperConfig;
|
||||||
}
|
}
|
||||||
// Paper end - add paper world config
|
// Paper end - add paper world config
|
||||||
@@ -1000,7 +1001,7 @@ index ca89d1593bf1b46c79a882db528cbca1359dc9d4..a0a68ff09689d457f3c6e17f3e5d6d59
|
|||||||
|
|
||||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||||
@@ -216,9 +222,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -213,9 +219,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
|
|
||||||
@@ -1013,7 +1014,7 @@ index ca89d1593bf1b46c79a882db528cbca1359dc9d4..a0a68ff09689d457f3c6e17f3e5d6d59
|
|||||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index af2c7758373ca3ecd53ca185f6730c284e964b26..870da24cb911f1cad20c79cc1bfbf3dc69ed3b83 100644
|
index 6d01828434b8dce0359fe2a37b450e0aae916e3b..ec7c15ceb51388a7a349b2e852693f09757c6cc5 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1054,6 +1054,7 @@ public final class CraftServer implements Server {
|
@@ -1054,6 +1054,7 @@ public final class CraftServer implements Server {
|
||||||
@@ -1033,10 +1034,10 @@ index af2c7758373ca3ecd53ca185f6730c284e964b26..870da24cb911f1cad20c79cc1bfbf3dc
|
|||||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index 8d626fadcd4743b6472a2954d2b1b2ec89669814..7107b54327f76bbd5265898f09e166423fee96e0 100644
|
index c988afa496d25314451435eedd64079a0d87cef0..2453abb371c6a7ba407ff2d906391d6a13ed5d6b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -174,6 +174,14 @@ public class Main {
|
@@ -175,6 +175,14 @@ public class Main {
|
||||||
.describedAs("Jar file");
|
.describedAs("Jar file");
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
|
|||||||
@@ -219,10 +219,10 @@ index 0000000000000000000000000000000000000000..f0037f98e93fd1f0dea9c224ba402ebc
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index ca9013a7141a4e6b5b45651961dd977929a0756b..1f169b9bc09052137187654a7331033779694ad4 100644
|
index 91d3224cb30f62008a116fa4f913b06928d43c0a..6aacf5ff736bcbbb8582b6ae11e7dfc6ff265c08 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1743,6 +1743,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1802,6 +1802,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
||||||
@@ -231,10 +231,10 @@ index ca9013a7141a4e6b5b45651961dd977929a0756b..1f169b9bc09052137187654a73310337
|
|||||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index a0a68ff09689d457f3c6e17f3e5d6d595f84684a..702bd6f2468559d425a95f8ad2622e98c373c065 100644
|
index 3a30562a4ec500eade01b646aacbdfbba39f547b..62d39dd63e33c2781c39d3241130b32c18093fcf 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -177,6 +177,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -174,6 +174,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return this.sakuraConfig;
|
return this.sakuraConfig;
|
||||||
}
|
}
|
||||||
// Sakura end
|
// Sakura end
|
||||||
@@ -248,10 +248,10 @@ index a0a68ff09689d457f3c6e17f3e5d6d595f84684a..702bd6f2468559d425a95f8ad2622e98
|
|||||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
index 00357d78182b3ff87e3d9a45705b072af56739c8..a2c2e2a5c5225c136ed325e7ce8917a366f599d2 100644
|
index f2b20ed5063a293f0b464548f590d652170cd1d8..b9c1fb2d1a185dc460bb6ba8b3d833fec40865e5 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
@@ -244,6 +244,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@@ -252,6 +252,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
|
|||||||
@@ -238,10 +238,10 @@ index 0000000000000000000000000000000000000000..115addbbed36b9c10c123450a0f6400c
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||||
index ccdc2345465313991f065e1176b58fb7d5e8722f..ab8bb26bceb2ec6f541aab348d420b9390c8c47a 100644
|
index 1a37654aff9a9c86c9f7af10a1cf721371f0c5ec..82644b34a77dc5e5af38260b7b07b3ec9aceae33 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||||
@@ -16,7 +16,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
|
@@ -19,7 +19,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
|
||||||
private static final int POS_IN_SECTION_BITS = 12;
|
private static final int POS_IN_SECTION_BITS = 12;
|
||||||
private final SectionPos sectionPos;
|
private final SectionPos sectionPos;
|
||||||
private final short[] positions;
|
private final short[] positions;
|
||||||
@@ -251,10 +251,10 @@ index ccdc2345465313991f065e1176b58fb7d5e8722f..ab8bb26bceb2ec6f541aab348d420b93
|
|||||||
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, ShortSet positions, LevelChunkSection section) {
|
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, ShortSet positions, LevelChunkSection section) {
|
||||||
this.sectionPos = sectionPos;
|
this.sectionPos = sectionPos;
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 1f169b9bc09052137187654a7331033779694ad4..8e2ee508d2290ace16714ed9927983f29a230304 100644
|
index 6aacf5ff736bcbbb8582b6ae11e7dfc6ff265c08..6e6ca00b20072e65370a47d38dded747fc0eb7c9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1744,6 +1744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1803,6 +1803,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
||||||
worldserver.localConfig().expire(currentTickLong); // Sakura
|
worldserver.localConfig().expire(currentTickLong); // Sakura
|
||||||
@@ -263,10 +263,10 @@ index 1f169b9bc09052137187654a7331033779694ad4..8e2ee508d2290ace16714ed9927983f2
|
|||||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 12109446fc76a39faee6cda042ca48b3fd3809f4..bb6a2be67394b9a6904d759b7564008dd1c282b3 100644
|
index dbe9df1e1973db133f7c8516256697ef7c968137..0bfd2005dc82b0262badfe6867835e80a6e6a1dc 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1424,6 +1424,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1438,6 +1438,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
// Paper end - Configurable entity tracking range by Y
|
// Paper end - Configurable entity tracking range by Y
|
||||||
|
|
||||||
@@ -290,10 +290,10 @@ index 12109446fc76a39faee6cda042ca48b3fd3809f4..bb6a2be67394b9a6904d759b7564008d
|
|||||||
if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
|
if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
|
||||||
flag = false;
|
flag = false;
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index 529ab44baaf573b97cf7e89560c548642733188f..cce8f45c15b9a9acfbf9b769f7670cfd0969d62f 100644
|
index 4f103f731623a8570238a6867fda1c5f83fca4e4..2835f102559edcd6e7891a83125d84f5553565da 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -47,6 +47,13 @@ import net.minecraft.util.Mth;
|
@@ -51,6 +51,13 @@ import net.minecraft.util.Mth;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -307,7 +307,7 @@ index 529ab44baaf573b97cf7e89560c548642733188f..cce8f45c15b9a9acfbf9b769f7670cfd
|
|||||||
|
|
||||||
public class ServerEntity {
|
public class ServerEntity {
|
||||||
|
|
||||||
@@ -290,6 +297,18 @@ public class ServerEntity {
|
@@ -297,6 +304,18 @@ public class ServerEntity {
|
||||||
this.entity.startSeenByPlayer(player);
|
this.entity.startSeenByPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ index 529ab44baaf573b97cf7e89560c548642733188f..cce8f45c15b9a9acfbf9b769f7670cfd
|
|||||||
public void sendPairingData(ServerPlayer player, Consumer<Packet<ClientGamePacketListener>> sender) {
|
public void sendPairingData(ServerPlayer player, Consumer<Packet<ClientGamePacketListener>> sender) {
|
||||||
if (this.entity.isRemoved()) {
|
if (this.entity.isRemoved()) {
|
||||||
// CraftBukkit start - Remove useless error spam, just return
|
// CraftBukkit start - Remove useless error spam, just return
|
||||||
@@ -298,12 +317,19 @@ public class ServerEntity {
|
@@ -305,12 +324,19 @@ public class ServerEntity {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ index 529ab44baaf573b97cf7e89560c548642733188f..cce8f45c15b9a9acfbf9b769f7670cfd
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean flag = this.trackDelta;
|
boolean flag = this.trackDelta;
|
||||||
@@ -373,6 +399,32 @@ public class ServerEntity {
|
@@ -375,6 +401,32 @@ public class ServerEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,7 @@ index 529ab44baaf573b97cf7e89560c548642733188f..cce8f45c15b9a9acfbf9b769f7670cfd
|
|||||||
|
|
||||||
private void sendDirtyEntityData() {
|
private void sendDirtyEntityData() {
|
||||||
SynchedEntityData datawatcher = this.entity.getEntityData();
|
SynchedEntityData datawatcher = this.entity.getEntityData();
|
||||||
@@ -380,7 +432,7 @@ public class ServerEntity {
|
@@ -382,7 +434,7 @@ public class ServerEntity {
|
||||||
|
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
this.trackedDataValues = datawatcher.getNonDefaultValues();
|
this.trackedDataValues = datawatcher.getNonDefaultValues();
|
||||||
@@ -391,10 +391,10 @@ index 529ab44baaf573b97cf7e89560c548642733188f..cce8f45c15b9a9acfbf9b769f7670cfd
|
|||||||
|
|
||||||
if (this.entity instanceof LivingEntity) {
|
if (this.entity instanceof LivingEntity) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index ed7b9d9a3856cf36b64e629a86c2e9bdac381eb3..5df1d01c52b527ff74778d8e4aa27b3b0b1e7a4b 100644
|
index cffdb530be035d177ccfd13a9e560c544f3acaac..bb1b891d917ed41ce5da6c2c9f470c5f49eff34a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1952,7 +1952,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1959,7 +1959,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
||||||
|
|
||||||
@@ -404,18 +404,18 @@ index ed7b9d9a3856cf36b64e629a86c2e9bdac381eb3..5df1d01c52b527ff74778d8e4aa27b3b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index b3781efbd3edcf102fe1bda5d6149915dc1127c6..68ea7cd8148ff4a80da761cf38e73bfa15f93b97 100644
|
index 8437316888c6056060a2780652147590b6fe7443..826fca7c9e1b49b8fbedbc4d99d55b85b4faa807 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -261,6 +261,7 @@ public class ServerPlayer extends Player {
|
@@ -277,6 +277,7 @@ public class ServerPlayer extends Player {
|
||||||
public final int[] mobCounts = new int[MOBCATEGORY_TOTAL_ENUMS]; // Paper
|
public final int[] mobCounts = new int[MOBCATEGORY_TOTAL_ENUMS]; // Paper
|
||||||
// Paper end - Optional per player mob spawns
|
// Paper end - Optional per player mob spawns
|
||||||
public final int[] mobBackoffCounts = new int[MOBCATEGORY_TOTAL_ENUMS]; // Paper - per player mob count backoff
|
public final int[] mobBackoffCounts = new int[MOBCATEGORY_TOTAL_ENUMS]; // Paper - per player mob count backoff
|
||||||
+ public final me.samsuik.sakura.player.visibility.Visibility visibility = new me.samsuik.sakura.player.visibility.Visibility(); // Sakura - visiblity api
|
+ public final me.samsuik.sakura.player.visibility.Visibility visibility = new me.samsuik.sakura.player.visibility.Visibility(); // Sakura - visiblity api
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public String displayName;
|
public CraftPlayer.TransferCookieConnection transferCookieConnection;
|
||||||
@@ -567,6 +568,15 @@ public class ServerPlayer extends Player {
|
@@ -595,6 +596,15 @@ public class ServerPlayer extends Player {
|
||||||
this.respawnDimension = (ResourceKey) dataresult1.resultOrPartial(logger1::error).orElse(Level.OVERWORLD);
|
this.respawnDimension = (ResourceKey) dataresult1.resultOrPartial(logger1::error).orElse(Level.OVERWORLD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -427,11 +427,11 @@ index b3781efbd3edcf102fe1bda5d6149915dc1127c6..68ea7cd8148ff4a80da761cf38e73bfa
|
|||||||
+ visibility.toggle(setting);
|
+ visibility.toggle(setting);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Sakura end
|
+ // Sakura end - visibility api
|
||||||
|
|
||||||
}
|
this.spawnExtraParticlesOnFall = nbt.getBoolean("spawn_extra_particles_on_fall");
|
||||||
|
Tag nbtbase = nbt.get("raid_omen_position");
|
||||||
@@ -633,6 +643,13 @@ public class ServerPlayer extends Player {
|
@@ -673,6 +683,13 @@ public class ServerPlayer extends Player {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.getBukkitEntity().setExtraData(nbt); // CraftBukkit
|
this.getBukkitEntity().setExtraData(nbt); // CraftBukkit
|
||||||
@@ -441,56 +441,55 @@ index b3781efbd3edcf102fe1bda5d6149915dc1127c6..68ea7cd8148ff4a80da761cf38e73bfa
|
|||||||
+ tag.putBoolean(setting.name(), visibility.isToggled(setting));
|
+ tag.putBoolean(setting.name(), visibility.isToggled(setting));
|
||||||
+ }
|
+ }
|
||||||
+ nbt.put("Sakura.Visuals", tag);
|
+ nbt.put("Sakura.Visuals", tag);
|
||||||
+ // Sakura end
|
+ // Sakura end - visibility api
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
nbt.putBoolean("spawn_extra_particles_on_fall", this.spawnExtraParticlesOnFall);
|
||||||
|
if (this.raidOmenPosition != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
index 0306771b8f90dcdd77f151c19c6c2d75c41f8feb..7451f65cef49248793815965bda4bcbe257b722e 100644
|
index 8ac5d8ccf731100a1be690cb2ed1be82cadba8ed..9a5e0e244068d9ef424bcf2c466a2bf21f1fcaf8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
@@ -40,6 +40,23 @@ import org.bukkit.craftbukkit.util.Waitable;
|
@@ -42,6 +42,23 @@ import org.bukkit.craftbukkit.util.CraftLocation;
|
||||||
|
import org.bukkit.craftbukkit.util.Waitable;
|
||||||
import org.bukkit.event.player.PlayerKickEvent;
|
import org.bukkit.event.player.PlayerKickEvent;
|
||||||
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
|
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
|
||||||
// CraftBukkit end
|
|
||||||
+// Sakura start
|
+// Sakura start
|
||||||
+import com.mojang.datafixers.util.Pair;
|
+import com.mojang.datafixers.util.Pair;
|
||||||
+import me.samsuik.sakura.player.visibility.Visibility.Setting;
|
+import me.samsuik.sakura.player.visibility.Visibility.Setting;
|
||||||
+import net.minecraft.world.level.block.Blocks;
|
+import net.minecraft.core.component.DataComponents;
|
||||||
+import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
+import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||||
+import net.minecraft.network.protocol.game.ClientboundBlockEventPacket;
|
+import net.minecraft.network.protocol.game.ClientboundBlockEventPacket;
|
||||||
+import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
|
+import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
|
||||||
+import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
|
|
||||||
+import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData.BlockEntityTagOutput;
|
|
||||||
+import net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket;
|
+import net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket;
|
||||||
+import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
|
+import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
|
||||||
|
+import net.minecraft.world.entity.EquipmentSlot;
|
||||||
|
+import net.minecraft.world.item.ItemStack;
|
||||||
|
+import net.minecraft.world.level.block.Blocks;
|
||||||
+import net.minecraft.world.level.block.DiodeBlock;
|
+import net.minecraft.world.level.block.DiodeBlock;
|
||||||
+import net.minecraft.world.level.block.entity.BlockEntityType;
|
|
||||||
+import net.minecraft.world.level.block.RedStoneWireBlock;
|
+import net.minecraft.world.level.block.RedStoneWireBlock;
|
||||||
+import net.minecraft.world.level.block.piston.PistonBaseBlock;
|
+import net.minecraft.world.level.block.piston.PistonBaseBlock;
|
||||||
+import net.minecraft.world.level.block.piston.PistonHeadBlock;
|
+import net.minecraft.world.level.block.piston.PistonHeadBlock;
|
||||||
+// Sakura end
|
+// Sakura end
|
||||||
|
|
||||||
public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener {
|
public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener, CraftPlayer.TransferCookieConnection {
|
||||||
|
|
||||||
@@ -247,6 +264,61 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -94,6 +111,65 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
} else if (packet instanceof ClientboundSetDefaultSpawnPositionPacket) {
|
protected final org.bukkit.craftbukkit.CraftServer cserver;
|
||||||
ClientboundSetDefaultSpawnPositionPacket packet6 = (ClientboundSetDefaultSpawnPositionPacket) packet;
|
public boolean processedDisconnect;
|
||||||
this.player.compassTarget = CraftLocation.toBukkit(packet6.pos, this.getCraftPlayer().getWorld());
|
|
||||||
+ // Sakura start - visibility api
|
+ // Sakura start - visibility api
|
||||||
+ } else if (!player.visibility.isModified()) {
|
+ private @Nullable Packet<?> recreatePacket(Packet<?> packet) {
|
||||||
+ // Skip players that haven't modified their settings
|
+ me.samsuik.sakura.player.visibility.Visibility visibility = this.player.visibility;
|
||||||
+ } else if (packet instanceof ClientboundSetEquipmentPacket equipment
|
+ if (packet instanceof ClientboundSetEquipmentPacket equipment && visibility.isToggled(Setting.ENCHANTMENT_GLINT)) {
|
||||||
+ && player.visibility.isToggled(Setting.ENCHANTMENT_GLINT)) {
|
+ java.util.List<Pair<EquipmentSlot, ItemStack>> slots = new java.util.ArrayList<>();
|
||||||
+ var slots = new java.util.ArrayList<Pair<net.minecraft.world.entity.EquipmentSlot, net.minecraft.world.item.ItemStack>>();
|
|
||||||
+
|
+
|
||||||
+ for (int i = 0; i < equipment.getSlots().size(); i++) {
|
+ for (int i = 0; i < equipment.getSlots().size(); i++) {
|
||||||
+ var pair = equipment.getSlots().get(i);
|
+ Pair<EquipmentSlot, ItemStack> pair = equipment.getSlots().get(i);
|
||||||
+ var itemstack = pair.getSecond();
|
+ ItemStack itemstack = pair.getSecond();
|
||||||
+
|
+
|
||||||
+ if (itemstack.isEnchanted()) {
|
+ if (itemstack.isEnchanted()) {
|
||||||
+ var copy = itemstack.copy();
|
+ ItemStack copy = itemstack.copy();
|
||||||
+ copy.getTag().remove("ench");
|
+ copy.remove(DataComponents.ENCHANTMENTS);
|
||||||
+ itemstack = copy;
|
+ itemstack = copy;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -499,43 +498,61 @@ index 0306771b8f90dcdd77f151c19c6c2d75c41f8feb..7451f65cef49248793815965bda4bcbe
|
|||||||
+
|
+
|
||||||
+ packet = new ClientboundSetEquipmentPacket(equipment.getEntity(), slots);
|
+ packet = new ClientboundSetEquipmentPacket(equipment.getEntity(), slots);
|
||||||
+ } else if (packet instanceof ClientboundBlockEntityDataPacket blockdata
|
+ } else if (packet instanceof ClientboundBlockEntityDataPacket blockdata
|
||||||
+ && player.visibility.isToggled(Setting.SPAWNERS)
|
+ && visibility.isToggled(Setting.SPAWNERS)
|
||||||
+ && player.level().getBlockIfLoaded(blockdata.getPos()) == Blocks.SPAWNER) {
|
+ && this.player.level().getBlockIfLoaded(blockdata.getPos()) == Blocks.SPAWNER) {
|
||||||
+ packet = new ClientboundBlockUpdatePacket(blockdata.getPos(), Blocks.BLACK_STAINED_GLASS.defaultBlockState());
|
+ packet = new ClientboundBlockUpdatePacket(blockdata.getPos(), Blocks.BLACK_STAINED_GLASS.defaultBlockState());
|
||||||
+ } else if (packet instanceof ClientboundBlockUpdatePacket updatePacket) {
|
+ } else if (packet instanceof ClientboundBlockUpdatePacket updatePacket) {
|
||||||
+ if (player.visibility.isToggled(Setting.SPAWNERS) && updatePacket.blockState.getBlock() == Blocks.SPAWNER) {
|
+ if (visibility.isToggled(Setting.SPAWNERS) && updatePacket.blockState.getBlock() == Blocks.SPAWNER) {
|
||||||
+ packet = new ClientboundBlockUpdatePacket(updatePacket.getPos(), Blocks.BLACK_STAINED_GLASS.defaultBlockState());
|
+ packet = new ClientboundBlockUpdatePacket(updatePacket.getPos(), Blocks.BLACK_STAINED_GLASS.defaultBlockState());
|
||||||
+ } else if (player.visibility.isToggled(Setting.REDSTONE)
|
+ } else if (visibility.isToggled(Setting.REDSTONE)
|
||||||
+ && (updatePacket.blockState.getBlock() instanceof DiodeBlock
|
+ && (updatePacket.blockState.getBlock() instanceof DiodeBlock
|
||||||
+ || updatePacket.blockState.getBlock() instanceof RedStoneWireBlock)) {
|
+ || updatePacket.blockState.getBlock() instanceof RedStoneWireBlock)) {
|
||||||
+ return;
|
+ return null;
|
||||||
+ } else if (player.visibility.isToggled(Setting.PISTONS)
|
+ } else if (visibility.isToggled(Setting.PISTONS)
|
||||||
+ && (updatePacket.blockState.getBlock() instanceof PistonBaseBlock
|
+ && (updatePacket.blockState.getBlock() instanceof PistonBaseBlock
|
||||||
+ || updatePacket.blockState.getBlock() instanceof PistonHeadBlock)) {
|
+ || updatePacket.blockState.getBlock() instanceof PistonHeadBlock)) {
|
||||||
+ return;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ } else if (packet instanceof ClientboundSectionBlocksUpdatePacket sectionPacket) {
|
+ } else if (packet instanceof ClientboundSectionBlocksUpdatePacket sectionPacket) {
|
||||||
+ for (var state : sectionPacket.states) {
|
+ for (net.minecraft.world.level.block.state.BlockState state : sectionPacket.states) {
|
||||||
+ if (player.visibility.isToggled(Setting.REDSTONE)
|
+ if (visibility.isToggled(Setting.REDSTONE)
|
||||||
+ && (state.getBlock() instanceof DiodeBlock
|
+ && (state.getBlock() instanceof DiodeBlock
|
||||||
+ || state.getBlock() instanceof RedStoneWireBlock)) {
|
+ || state.getBlock() instanceof RedStoneWireBlock)) {
|
||||||
+ return;
|
+ return null;
|
||||||
+ } else if (player.visibility.isToggled(Setting.PISTONS)
|
+ } else if (visibility.isToggled(Setting.PISTONS)
|
||||||
+ && (state.getBlock() instanceof PistonBaseBlock
|
+ && (state.getBlock() instanceof PistonBaseBlock
|
||||||
+ || state.getBlock() instanceof PistonHeadBlock)) {
|
+ || state.getBlock() instanceof PistonHeadBlock)) {
|
||||||
+ return;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ } else if (packet instanceof ClientboundBlockEventPacket blockevent
|
+ } else if (packet instanceof ClientboundBlockEventPacket blockevent
|
||||||
+ && player.visibility.isToggled(Setting.PISTONS)
|
+ && visibility.isToggled(Setting.PISTONS)
|
||||||
+ && (blockevent.getBlock() instanceof PistonBaseBlock
|
+ && (blockevent.getBlock() instanceof PistonBaseBlock
|
||||||
+ || blockevent.getBlock() instanceof PistonHeadBlock)) {
|
+ || blockevent.getBlock() instanceof PistonHeadBlock)) {
|
||||||
+ return;
|
+ return null;
|
||||||
+ // Sakura end
|
+ }
|
||||||
}
|
+
|
||||||
|
+ return packet;
|
||||||
|
+ }
|
||||||
|
+ // Sakura end - visibility api
|
||||||
|
+
|
||||||
|
public CraftPlayer getCraftPlayer() {
|
||||||
|
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
boolean flag = !this.suspendFlushingOnServerThread || !this.server.isSameThread();
|
@@ -300,6 +376,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
@@ -257,8 +329,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
ClientboundSetDefaultSpawnPositionPacket packet6 = (ClientboundSetDefaultSpawnPositionPacket) packet;
|
||||||
|
this.player.compassTarget = CraftLocation.toBukkit(packet6.pos, this.getCraftPlayer().getWorld());
|
||||||
|
}
|
||||||
|
+ // Sakura start - visibility api
|
||||||
|
+ if (this.player.visibility.isModified()) {
|
||||||
|
+ packet = this.recreatePacket(packet);
|
||||||
|
+ if (packet == null) return;
|
||||||
|
+ }
|
||||||
|
+ // Sakura end - visibility api
|
||||||
|
// CraftBukkit end
|
||||||
|
if (packet.isTerminal()) {
|
||||||
|
this.close();
|
||||||
|
@@ -313,8 +395,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Sending packet");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Sending packet");
|
||||||
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Packet being sent");
|
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Packet being sent");
|
||||||
|
|
||||||
@@ -549,10 +566,10 @@ index 0306771b8f90dcdd77f151c19c6c2d75c41f8feb..7451f65cef49248793815965bda4bcbe
|
|||||||
throw new ReportedException(crashreport);
|
throw new ReportedException(crashreport);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index fe2ef36ab5dc4b933abf24dbfd0e811c53239cf0..d6e60e4e7b5410f30b47e6b9b57b390837368dfc 100644
|
index 5e9202bc7fc649764568b55d66ba0d684118c00c..9dd069659a7ec93b9f0c65edd233952548881870 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -3116,6 +3116,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -3198,6 +3198,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
event.setCancelled(cancelled);
|
event.setCancelled(cancelled);
|
||||||
AbstractContainerMenu oldContainer = this.player.containerMenu; // SPIGOT-1224
|
AbstractContainerMenu oldContainer = this.player.containerMenu; // SPIGOT-1224
|
||||||
@@ -561,10 +578,10 @@ index fe2ef36ab5dc4b933abf24dbfd0e811c53239cf0..d6e60e4e7b5410f30b47e6b9b57b3908
|
|||||||
if (this.player.containerMenu != oldContainer) {
|
if (this.player.containerMenu != oldContainer) {
|
||||||
return;
|
return;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 637478fd8a284e6833cf8f5fa17ccf9d73d1dd3f..7e4ed21080c56961713f35e219dd592f5f717d63 100644
|
index 2bc85351e6e52f90da5fdb29d8d042a06132d742..6872b9624be78e252df54858d8b9cb5aae93ceda 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -567,6 +567,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -569,6 +569,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
public boolean updatingSectionStatus = false;
|
public boolean updatingSectionStatus = false;
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -576,7 +593,7 @@ index 637478fd8a284e6833cf8f5fa17ccf9d73d1dd3f..7e4ed21080c56961713f35e219dd592f
|
|||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index a52c2fc38fd97ffa1684270443646d605ec35830..4f072853272bedd79bdf53d2a8373d8e0f6fdd29 100644
|
index d504d10fbe45dfe3f2f3d08d2473df6cd18f6dcf..28b8efdd224e4dbb32f3eac1c9e2c512e2695dc8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -74,6 +74,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -74,6 +74,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
@@ -588,10 +605,10 @@ index a52c2fc38fd97ffa1684270443646d605ec35830..4f072853272bedd79bdf53d2a8373d8e
|
|||||||
|
|
||||||
public FallingBlockEntity(Level world, double x, double y, double z, BlockState block) {
|
public FallingBlockEntity(Level world, double x, double y, double z, BlockState block) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 e712bd07ea2946167782473a536e0c72fab4bccd..2e6691b86e161616bb2dcf5ce0391ad57a3ef422 100644
|
index f1f352ec0e51f5db59254841a06c176c5a876fc9..dace8dc0c051ce9355d878154466ee3a548a3832 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -39,6 +39,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -37,6 +37,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
public PrimedTnt(EntityType<? extends PrimedTnt> type, Level world) {
|
public PrimedTnt(EntityType<? extends PrimedTnt> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
this.blocksBuilding = true;
|
this.blocksBuilding = true;
|
||||||
@@ -600,10 +617,10 @@ index e712bd07ea2946167782473a536e0c72fab4bccd..2e6691b86e161616bb2dcf5ce0391ad5
|
|||||||
|
|
||||||
public PrimedTnt(Level world, double x, double y, double z, @Nullable LivingEntity igniter) {
|
public PrimedTnt(Level world, double x, double y, double z, @Nullable LivingEntity igniter) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 702bd6f2468559d425a95f8ad2622e98c373c065..dc8d34adac1a2834777a8fe1fe7f142e0b13c0bf 100644
|
index 62d39dd63e33c2781c39d3241130b32c18093fcf..52c203dcc1e0ba6b0b236412dadfb1fed2a8ea31 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -228,6 +228,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -225,6 +225,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
|
|
||||||
@@ -613,10 +630,10 @@ index 702bd6f2468559d425a95f8ad2622e98c373c065..dc8d34adac1a2834777a8fe1fe7f142e
|
|||||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
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
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 44f4665db613c558078df5bb49106e4ca5679dfe..29f0c4c3fd9185bf8768572c135b50a9db34dbbe 100644
|
index 5f896948d158651cd9837364759dbfbcce6b7d21..73068dfe3c721b38e7f00767f3c94dc1d2589a13 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -458,6 +458,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -543,6 +543,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
this.getHandle().displayName = name == null ? this.getName() : name;
|
this.getHandle().displayName = name == null ? this.getName() : name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise rayTracing
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 90a82bd7977ebe520bdcc2ab99e11452d5cf4a21..eeacf65ebb0ea7070de6e773d31651e4c190d592 100644
|
index dc88014c4d9f172cc54e5d77b488128f9ffbc73d..9ea24dc18f70e8e3c8998f6c2b5eb3ac885df54f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -295,7 +295,7 @@ public class Explosion {
|
@@ -296,7 +296,7 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Reduce deltaMovement Allocations
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b021a0ae6cf 100644
|
index 6872b9624be78e252df54858d8b9cb5aae93ceda..9aebb8f4c98eec7ece2eed012971d417062f76d0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1253,7 +1253,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1295,7 +1295,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.tryCheckInsideBlocks();
|
this.tryCheckInsideBlocks();
|
||||||
float f = this.getBlockSpeedFactor();
|
float f = this.getBlockSpeedFactor();
|
||||||
|
|
||||||
@@ -17,7 +17,16 @@ index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b02
|
|||||||
// Paper start - remove expensive streams from here
|
// Paper start - remove expensive streams from here
|
||||||
boolean noneMatch = true;
|
boolean noneMatch = true;
|
||||||
AABB fireSearchBox = this.getBoundingBox().deflate(1.0E-6D);
|
AABB fireSearchBox = this.getBoundingBox().deflate(1.0E-6D);
|
||||||
@@ -2069,6 +2069,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1832,7 +1832,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
double d0 = this.getGravity();
|
||||||
|
|
||||||
|
if (d0 != 0.0D) {
|
||||||
|
- this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -d0, 0.0D));
|
||||||
|
+ this.addDeltaMovement(0.0D, -d0, 0.0D); // Sakura - reduce movement allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -2124,6 +2124,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
||||||
// Paper start - Fix Entity Teleportation and cancel velocity if teleported
|
// Paper start - Fix Entity Teleportation and cancel velocity if teleported
|
||||||
if (!preserveMotion) {
|
if (!preserveMotion) {
|
||||||
@@ -25,7 +34,7 @@ index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b02
|
|||||||
this.deltaMovement = Vec3.ZERO;
|
this.deltaMovement = Vec3.ZERO;
|
||||||
} else {
|
} else {
|
||||||
this.preserveMotion = false;
|
this.preserveMotion = false;
|
||||||
@@ -3473,29 +3474,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -3520,29 +3521,33 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAboveBubbleCol(boolean drag) {
|
public void onAboveBubbleCol(boolean drag) {
|
||||||
@@ -67,7 +76,7 @@ index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b02
|
|||||||
this.resetFallDistance();
|
this.resetFallDistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4484,16 +4489,19 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4541,16 +4546,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
vec3d = vec3d.normalize();
|
vec3d = vec3d.normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +99,7 @@ index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b02
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.fluidHeight.put(tag, d1);
|
this.fluidHeight.put(tag, d1);
|
||||||
@@ -4564,11 +4572,53 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4621,11 +4629,53 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return this.chunkPosition;
|
return this.chunkPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +153,7 @@ index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b02
|
|||||||
synchronized (this.posLock) { // Paper
|
synchronized (this.posLock) { // Paper
|
||||||
this.deltaMovement = velocity;
|
this.deltaMovement = velocity;
|
||||||
} // Paper
|
} // Paper
|
||||||
@@ -4579,7 +4629,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4636,7 +4686,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDeltaMovement(double x, double y, double z) {
|
public void setDeltaMovement(double x, double y, double z) {
|
||||||
@@ -158,19 +167,10 @@ index 7e4ed21080c56961713f35e219dd592f5f717d63..5fbcdbaf4c0344dc3e8fff7bf31c2b02
|
|||||||
|
|
||||||
public final int getBlockX() {
|
public final int getBlockX() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 4f072853272bedd79bdf53d2a8373d8e0f6fdd29..91aa2714bae3f8f5d0fb76426b2b8cfc61941f54 100644
|
index 28b8efdd224e4dbb32f3eac1c9e2c512e2695dc8..7da6420aed597ee1bf544059c79a063512adcd40 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -141,7 +141,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -183,7 +183,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
|
|
||||||
++this.time;
|
|
||||||
if (!this.isNoGravity()) {
|
|
||||||
- this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -0.04D, 0.0D));
|
|
||||||
+ this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
||||||
@@ -181,7 +181,7 @@ public class FallingBlockEntity extends Entity {
|
|
||||||
} else {
|
} else {
|
||||||
BlockState iblockdata = this.level().getBlockState(blockposition);
|
BlockState iblockdata = this.level().getBlockState(blockposition);
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ index 4f072853272bedd79bdf53d2a8373d8e0f6fdd29..91aa2714bae3f8f5d0fb76426b2b8cfc
|
|||||||
if (!iblockdata.is(Blocks.MOVING_PISTON)) {
|
if (!iblockdata.is(Blocks.MOVING_PISTON)) {
|
||||||
if (!this.cancelDrop) {
|
if (!this.cancelDrop) {
|
||||||
boolean flag2 = iblockdata.canBeReplaced((BlockPlaceContext) (new DirectionalPlaceContext(this.level(), blockposition, Direction.DOWN, ItemStack.EMPTY, Direction.UP)));
|
boolean flag2 = iblockdata.canBeReplaced((BlockPlaceContext) (new DirectionalPlaceContext(this.level(), blockposition, Direction.DOWN, ItemStack.EMPTY, Direction.UP)));
|
||||||
@@ -248,7 +248,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -250,7 +250,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,18 +189,9 @@ index 4f072853272bedd79bdf53d2a8373d8e0f6fdd29..91aa2714bae3f8f5d0fb76426b2b8cfc
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 2e6691b86e161616bb2dcf5ce0391ad57a3ef422..7890f84d7a69e2e6820ef0daa35f898534f7372f 100644
|
index dace8dc0c051ce9355d878154466ee3a548a3832..fda88328472130df8317a84fc726a73c35850c3a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -75,7 +75,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
|
||||||
public void tick() {
|
|
||||||
if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
|
||||||
if (!this.isNoGravity()) {
|
|
||||||
- this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -0.04D, 0.0D));
|
|
||||||
+ this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
||||||
@@ -85,9 +85,9 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -85,9 +85,9 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -214,10 +205,10 @@ index 2e6691b86e161616bb2dcf5ce0391ad57a3ef422..7890f84d7a69e2e6820ef0daa35f8985
|
|||||||
|
|
||||||
int i = this.getFuse() - 1;
|
int i = this.getFuse() - 1;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index eeacf65ebb0ea7070de6e773d31651e4c190d592..8fd87dc8f925a160bf390b05040110735f2a145b 100644
|
index 9ea24dc18f70e8e3c8998f6c2b5eb3ac885df54f..482609cb5395e626f7fc5890a6db3570c6a07166 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -617,10 +617,11 @@ public class Explosion {
|
@@ -618,10 +618,11 @@ public class Explosion {
|
||||||
d8 *= d13;
|
d8 *= d13;
|
||||||
d9 *= d13;
|
d9 *= d13;
|
||||||
d10 *= d13;
|
d10 *= d13;
|
||||||
@@ -230,7 +221,7 @@ index eeacf65ebb0ea7070de6e773d31651e4c190d592..8fd87dc8f925a160bf390b0504011073
|
|||||||
Vec3 result = entity.getDeltaMovement().add(vec3d1);
|
Vec3 result = entity.getDeltaMovement().add(vec3d1);
|
||||||
org.bukkit.event.entity.EntityKnockbackEvent event = CraftEventFactory.callEntityKnockbackEvent((org.bukkit.craftbukkit.entity.CraftLivingEntity) entity.getBukkitEntity(), this.source, org.bukkit.event.entity.EntityKnockbackEvent.KnockbackCause.EXPLOSION, d13, vec3d1, result.x, result.y, result.z);
|
org.bukkit.event.entity.EntityKnockbackEvent event = CraftEventFactory.callEntityKnockbackEvent((org.bukkit.craftbukkit.entity.CraftLivingEntity) entity.getBukkitEntity(), this.source, org.bukkit.event.entity.EntityKnockbackEvent.KnockbackCause.EXPLOSION, d13, vec3d1, result.x, result.y, result.z);
|
||||||
|
|
||||||
@@ -635,9 +636,13 @@ public class Explosion {
|
@@ -639,9 +640,13 @@ public class Explosion {
|
||||||
vec3d1 = org.bukkit.craftbukkit.util.CraftVector.toNMS(paperEvent.getAcceleration());
|
vec3d1 = org.bukkit.craftbukkit.util.CraftVector.toNMS(paperEvent.getAcceleration());
|
||||||
}
|
}
|
||||||
// Paper end - call EntityKnockbackByEntityEvent for explosions
|
// Paper end - call EntityKnockbackByEntityEvent for explosions
|
||||||
@@ -246,10 +237,10 @@ index eeacf65ebb0ea7070de6e773d31651e4c190d592..8fd87dc8f925a160bf390b0504011073
|
|||||||
Player entityhuman = (Player) entity;
|
Player entityhuman = (Player) entity;
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
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 22036ed3ea0629bc12981a8d91a03e55cc2117d6..73a453ef678ed90ebc1de4d1efc258ad81cf36b8 100644
|
index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..30e23f67a1a816dfb4f32cfe45bc8dd40938317a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
@@ -469,7 +469,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
@@ -461,7 +461,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntityAfterFallOn(BlockGetter world, Entity entity) {
|
public void updateEntityAfterFallOn(BlockGetter world, Entity entity) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks on Movement
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
index ee0331a6bc40cdde08d926fd8eb1dc642630c2e5..19086bbfdf3a015eafec5ca868c8d2451f554ef0 100644
|
index ee8e9c0e3690e78f3cc621ddfca89ea4256d4803..299237a0c828e48425cc35a14d366020c78daefb 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
@@ -1569,6 +1569,7 @@ public final class CollisionUtil {
|
@@ -1569,6 +1569,7 @@ public final class CollisionUtil {
|
||||||
@@ -51,10 +51,10 @@ index 658e63ebde81dc14c8ab5850fb246dc0aab25dea..f1ff1a67fee37ee7b241ceaa164fa4ee
|
|||||||
public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) {
|
public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) {
|
||||||
return new TicketType<>(name, argumentComparator, 0L);
|
return new TicketType<>(name, argumentComparator, 0L);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 5fbcdbaf4c0344dc3e8fff7bf31c2b021a0ae6cf..6e217474e7224cc5cc0a9818d39233c6757eca50 100644
|
index 9aebb8f4c98eec7ece2eed012971d417062f76d0..495d8b5606457e9bfbe63199855dcd2140cd43f5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -571,6 +571,19 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -573,6 +573,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
public boolean isPrimedTNT;
|
public boolean isPrimedTNT;
|
||||||
public boolean isFallingBlock;
|
public boolean isFallingBlock;
|
||||||
// Sakura end - visibility api and command
|
// Sakura end - visibility api and command
|
||||||
@@ -74,7 +74,7 @@ index 5fbcdbaf4c0344dc3e8fff7bf31c2b021a0ae6cf..6e217474e7224cc5cc0a9818d39233c6
|
|||||||
|
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
@@ -1514,7 +1527,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1556,7 +1569,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
io.papermc.paper.util.CollisionUtil.getCollisions(
|
io.papermc.paper.util.CollisionUtil.getCollisions(
|
||||||
world, this, collisionBox, potentialCollisionsVoxel, potentialCollisionsBB,
|
world, this, collisionBox, potentialCollisionsVoxel, potentialCollisionsBB,
|
||||||
@@ -83,7 +83,7 @@ index 5fbcdbaf4c0344dc3e8fff7bf31c2b021a0ae6cf..6e217474e7224cc5cc0a9818d39233c6
|
|||||||
null, null
|
null, null
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -4897,12 +4910,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4952,12 +4965,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldBeSaved() {
|
public boolean shouldBeSaved() {
|
||||||
@@ -99,7 +99,7 @@ index 5fbcdbaf4c0344dc3e8fff7bf31c2b021a0ae6cf..6e217474e7224cc5cc0a9818d39233c6
|
|||||||
|
|
||||||
public boolean mayInteract(Level world, BlockPos pos) {
|
public boolean mayInteract(Level world, BlockPos pos) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 91aa2714bae3f8f5d0fb76426b2b8cfc61941f54..aae2093c42d76af5bdb0d4bda3e5ee362a2143e3 100644
|
index 7da6420aed597ee1bf544059c79a063512adcd40..d9668a752b06b560730973ebc82251d2cb8b7123 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -75,6 +75,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -75,6 +75,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
@@ -111,10 +111,10 @@ index 91aa2714bae3f8f5d0fb76426b2b8cfc61941f54..aae2093c42d76af5bdb0d4bda3e5ee36
|
|||||||
|
|
||||||
public FallingBlockEntity(Level world, double x, double y, double z, BlockState block) {
|
public FallingBlockEntity(Level world, double x, double y, double z, BlockState block) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 5aa02f28b6be60688e340099b1637fb0ebfe7aa9..7a5ea7e0ea063eb0355dea89746a0e581548d131 100644
|
index bbf6b4f705b3e9b289a7fdf82a78ef02f777297d..431b02599b7e3f2730841c8136460177aca37f3b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -40,6 +40,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -38,6 +38,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
this.blocksBuilding = true;
|
this.blocksBuilding = true;
|
||||||
this.isPrimedTNT = true; // Sakura
|
this.isPrimedTNT = true; // Sakura
|
||||||
@@ -123,10 +123,10 @@ index 5aa02f28b6be60688e340099b1637fb0ebfe7aa9..7a5ea7e0ea063eb0355dea89746a0e58
|
|||||||
|
|
||||||
public PrimedTnt(Level world, double x, double y, double z, @Nullable LivingEntity igniter) {
|
public PrimedTnt(Level world, double x, double y, double z, @Nullable LivingEntity igniter) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
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 465458e8a7dbaf9afb32709a71c7b2620d1e1fd2..27b6baae9ac0feec2f2578540e29da6281593add 100644
|
index 2a8609e33716949ff1877b6d10f64a9d7a7c81e9..f0233059d84c59a88572ae4d95e25c790640410a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -218,6 +218,17 @@ public class LevelChunk extends ChunkAccess {
|
@@ -220,6 +220,17 @@ public class LevelChunk extends ChunkAccess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|||||||
@@ -418,10 +418,10 @@ index 0000000000000000000000000000000000000000..6903863ad293a335a8ed1aeaa06fccb4
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 8e2ee508d2290ace16714ed9927983f29a230304..3c98362624e1b02b6b028db95564254e044c7b0d 100644
|
index 6e6ca00b20072e65370a47d38dded747fc0eb7c9..783367f380ad2a21418d102fbb6bc49a71148ee8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1125,6 +1125,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1134,6 +1134,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static final java.math.BigDecimal TPS_BASE = new java.math.BigDecimal(1E9).multiply(new java.math.BigDecimal(SAMPLE_INTERVAL));
|
private static final java.math.BigDecimal TPS_BASE = new java.math.BigDecimal(1E9).multiply(new java.math.BigDecimal(SAMPLE_INTERVAL));
|
||||||
@@ -429,7 +429,7 @@ index 8e2ee508d2290ace16714ed9927983f29a230304..3c98362624e1b02b6b028db95564254e
|
|||||||
// Paper end
|
// Paper end
|
||||||
// Spigot End
|
// Spigot End
|
||||||
|
|
||||||
@@ -1203,6 +1204,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1212,6 +1213,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
|
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
|
||||||
final long diff = currentTime - tickSection;
|
final long diff = currentTime - tickSection;
|
||||||
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
||||||
@@ -437,7 +437,7 @@ index 8e2ee508d2290ace16714ed9927983f29a230304..3c98362624e1b02b6b028db95564254e
|
|||||||
tps1.add(currentTps, diff);
|
tps1.add(currentTps, diff);
|
||||||
tps5.add(currentTps, diff);
|
tps5.add(currentTps, diff);
|
||||||
tps15.add(currentTps, diff);
|
tps15.add(currentTps, diff);
|
||||||
@@ -1231,6 +1233,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1240,6 +1242,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.tickServer(flag ? () -> {
|
this.tickServer(flag ? () -> {
|
||||||
return false;
|
return false;
|
||||||
} : this::haveTime);
|
} : this::haveTime);
|
||||||
@@ -446,10 +446,10 @@ index 8e2ee508d2290ace16714ed9927983f29a230304..3c98362624e1b02b6b028db95564254e
|
|||||||
this.mayHaveDelayedTasks = true;
|
this.mayHaveDelayedTasks = true;
|
||||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
|
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..3662c364d0bf04c9d5ef3af84bceb4263c47df7f 100644
|
index b99f50604bafecbc68835974c9ed0caa91911a40..c912615ded011741f81c72739639e631f331710e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -92,6 +92,11 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -90,6 +90,11 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
this.clearCache();
|
this.clearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,15 +462,15 @@ index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..3662c364d0bf04c9d5ef3af84bceb426
|
|||||||
public boolean isChunkLoaded(int chunkX, int chunkZ) {
|
public boolean isChunkLoaded(int chunkX, int chunkZ) {
|
||||||
ChunkHolder chunk = this.chunkMap.getUpdatingChunkIfPresent(ChunkPos.asLong(chunkX, chunkZ));
|
ChunkHolder chunk = this.chunkMap.getUpdatingChunkIfPresent(ChunkPos.asLong(chunkX, chunkZ));
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 5df1d01c52b527ff74778d8e4aa27b3b0b1e7a4b..55e0be135ec084ee7ebe6bc7bb9323519e0cd864 100644
|
index bb1b891d917ed41ce5da6c2c9f470c5f49eff34a..b97217662434b67a62f7247c2b5187749f207880 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -193,7 +193,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -197,7 +197,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
public final ServerChunkCache chunkSource;
|
|
||||||
private final MinecraftServer server;
|
private final MinecraftServer server;
|
||||||
public final PrimaryLevelData serverLevelData; // CraftBukkit - type
|
public final PrimaryLevelData serverLevelData; // CraftBukkit - type
|
||||||
|
private int lastSpawnChunkRadius;
|
||||||
- final EntityTickList entityTickList;
|
- final EntityTickList entityTickList;
|
||||||
+ public final EntityTickList entityTickList; // Sakura - public!
|
+ public final EntityTickList entityTickList; // Sakura - package-private -> public
|
||||||
//public final PersistentEntitySectionManager<Entity> entityManager; // Paper - rewrite chunk system
|
//public final PersistentEntitySectionManager<Entity> entityManager; // Paper - rewrite chunk system
|
||||||
private final GameEventDispatcher gameEventDispatcher;
|
private final GameEventDispatcher gameEventDispatcher;
|
||||||
public boolean noSave;
|
public boolean noSave;
|
||||||
@@ -488,7 +488,7 @@ index 83a39f900551e39d5af6f17a339a386ddee4feef..172c8d9cc94ed6ddfd3f785ca97a6e6e
|
|||||||
private void ensureActiveIsNotIterated() {
|
private void ensureActiveIsNotIterated() {
|
||||||
// Paper - replace with better logic, do not delay removals
|
// Paper - replace with better logic, do not delay removals
|
||||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||||
index 6c260403d91d640da0473a3df56e1c5582459fde..2d2d1eeaeb9e7f36263b8cecc753adf721b96435 100644
|
index 6c2a3813e7d63d57f07a8fa2edbb9d231221d818..a7333afe790be4ca876cb15c5f32a085dd13c3bb 100644
|
||||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||||
@@ -283,7 +283,7 @@ public class SpigotConfig
|
@@ -283,7 +283,7 @@ public class SpigotConfig
|
||||||
|
|||||||
@@ -19,18 +19,18 @@ The current packets modified/obfuscated are the following:
|
|||||||
# with packets instead of every single player within tracking distance
|
# with packets instead of every single player within tracking distance
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
diff --git a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
||||||
index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c820019d6318e1 100644
|
index 0f99733660f91280e4c6262cf75b3c9cae86f65a..ba9f8fe6fafc54bbdfb104de28af4b392feb4483 100644
|
||||||
--- a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
--- a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
||||||
+++ b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
+++ b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
||||||
@@ -39,6 +39,7 @@ public class SynchedEntityData {
|
@@ -22,6 +22,7 @@ public class SynchedEntityData {
|
||||||
private static final int GROW_FACTOR = 8;
|
private final SyncedDataHolder entity;
|
||||||
private SynchedEntityData.DataItem<?>[] itemsArray = new SynchedEntityData.DataItem<?>[DEFAULT_ENTRY_COUNT];
|
private final SynchedEntityData.DataItem<?>[] itemsById;
|
||||||
// Paper end - Perf: array backed synched entity data
|
private boolean isDirty;
|
||||||
+ private boolean isForeignDirty; // Slice
|
+ private boolean isForeignDirty; // Slice
|
||||||
|
|
||||||
public SynchedEntityData(Entity trackedEntity) {
|
SynchedEntityData(SyncedDataHolder trackedEntity, SynchedEntityData.DataItem<?>[] entries) {
|
||||||
this.entity = trackedEntity;
|
this.entity = trackedEntity;
|
||||||
@@ -165,6 +166,16 @@ public class SynchedEntityData {
|
@@ -63,6 +64,16 @@ public class SynchedEntityData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void set(EntityDataAccessor<T> key, T value, boolean force) {
|
public <T> void set(EntityDataAccessor<T> key, T value, boolean force) {
|
||||||
@@ -47,7 +47,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
SynchedEntityData.DataItem<T> datawatcher_item = this.getItem(key);
|
SynchedEntityData.DataItem<T> datawatcher_item = this.getItem(key);
|
||||||
|
|
||||||
if (force || ObjectUtils.notEqual(value, datawatcher_item.getValue())) {
|
if (force || ObjectUtils.notEqual(value, datawatcher_item.getValue())) {
|
||||||
@@ -174,6 +185,12 @@ public class SynchedEntityData {
|
@@ -72,6 +83,12 @@ public class SynchedEntityData {
|
||||||
this.isDirty = true;
|
this.isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - add method from above
|
// CraftBukkit start - add method from above
|
||||||
@@ -183,6 +200,12 @@ public class SynchedEntityData {
|
@@ -81,6 +98,12 @@ public class SynchedEntityData {
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -73,8 +73,8 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
public boolean isDirty() {
|
public boolean isDirty() {
|
||||||
return this.isDirty;
|
return this.isDirty;
|
||||||
}
|
}
|
||||||
@@ -215,6 +238,29 @@ public class SynchedEntityData {
|
@@ -108,6 +131,29 @@ public class SynchedEntityData {
|
||||||
return list;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Slice start
|
+ // Slice start
|
||||||
@@ -83,7 +83,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
+ List<SynchedEntityData.DataValue<?>> list = null;
|
+ List<SynchedEntityData.DataValue<?>> list = null;
|
||||||
+
|
+
|
||||||
+ for (DataValue<?> dataItem : unpackedData) {
|
+ for (DataValue<?> dataItem : unpackedData) {
|
||||||
+ DataItem<?> item = itemsById.get(dataItem.id());
|
+ DataItem<?> item = this.itemsById[dataItem.id()];
|
||||||
+ if (item.isDirty(true)) {
|
+ if (item.isDirty(true)) {
|
||||||
+ item.setForeignDirty(false);
|
+ item.setForeignDirty(false);
|
||||||
+
|
+
|
||||||
@@ -103,7 +103,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
@Nullable
|
@Nullable
|
||||||
public List<SynchedEntityData.DataValue<?>> getNonDefaultValues() {
|
public List<SynchedEntityData.DataValue<?>> getNonDefaultValues() {
|
||||||
List<SynchedEntityData.DataValue<?>> list = null;
|
List<SynchedEntityData.DataValue<?>> list = null;
|
||||||
@@ -339,11 +385,14 @@ public class SynchedEntityData {
|
@@ -171,11 +217,14 @@ public class SynchedEntityData {
|
||||||
T value;
|
T value;
|
||||||
private final T initialValue;
|
private final T initialValue;
|
||||||
private boolean dirty;
|
private boolean dirty;
|
||||||
@@ -118,7 +118,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
}
|
}
|
||||||
|
|
||||||
public EntityDataAccessor<T> getAccessor() {
|
public EntityDataAccessor<T> getAccessor() {
|
||||||
@@ -370,6 +419,35 @@ public class SynchedEntityData {
|
@@ -202,6 +251,35 @@ public class SynchedEntityData {
|
||||||
return this.initialValue.equals(this.value);
|
return this.initialValue.equals(this.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,14 +129,14 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public @Nullable T getForeignValue() {
|
+ public @Nullable T getForeignValue() {
|
||||||
+ return foreignValue;
|
+ return this.foreignValue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public boolean isDirty(boolean foreign) {
|
+ public boolean isDirty(boolean foreign) {
|
||||||
+ if (foreign) {
|
+ if (foreign) {
|
||||||
+ //There must be a foreign value in order for this to be dirty, otherwise we consider this a normal
|
+ //There must be a foreign value in order for this to be dirty, otherwise we consider this a normal
|
||||||
+ //value and check the normal dirty flag.
|
+ //value and check the normal dirty flag.
|
||||||
+ return foreignValue == null || this.foreignDirty;
|
+ return this.foreignValue == null || this.foreignDirty;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return this.dirty;
|
+ return this.dirty;
|
||||||
@@ -147,7 +147,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public SynchedEntityData.DataValue<T> copy(boolean foreign) {
|
+ public SynchedEntityData.DataValue<T> copy(boolean foreign) {
|
||||||
+ return SynchedEntityData.DataValue.create(this.accessor, this.accessor.getSerializer().copy((foreign && this.foreignValue != null ? this.foreignValue : this.value)));
|
+ return SynchedEntityData.DataValue.create(this.accessor, this.accessor.serializer().copy((foreign && this.foreignValue != null ? this.foreignValue : this.value)));
|
||||||
+ }
|
+ }
|
||||||
+ // Slice end
|
+ // Slice end
|
||||||
+
|
+
|
||||||
@@ -155,7 +155,7 @@ index 58b602e550258c1062ee940bc46538dac95d8979..50c6647ef3755c3712bf095c14c82001
|
|||||||
return SynchedEntityData.DataValue.create(this.accessor, this.value);
|
return SynchedEntityData.DataValue.create(this.accessor, this.value);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index cce8f45c15b9a9acfbf9b769f7670cfd0969d62f..4237442c649845ffb0ff613e6c76ca478191e950 100644
|
index 2835f102559edcd6e7891a83125d84f5553565da..6ee16176563cf614df8bfc7c62d78fa1b4aa4412 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -148,7 +148,7 @@ public class ServerEntity {
|
@@ -148,7 +148,7 @@ public class ServerEntity {
|
||||||
@@ -167,7 +167,7 @@ index cce8f45c15b9a9acfbf9b769f7670cfd0969d62f..4237442c649845ffb0ff613e6c76ca47
|
|||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
@@ -401,11 +401,23 @@ public class ServerEntity {
|
@@ -403,11 +403,23 @@ public class ServerEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sakura start - visibility api
|
// Sakura start - visibility api
|
||||||
@@ -193,7 +193,7 @@ index cce8f45c15b9a9acfbf9b769f7670cfd0969d62f..4237442c649845ffb0ff613e6c76ca47
|
|||||||
var copyOfDirtyItems = Lists.newArrayList(packedValues);
|
var copyOfDirtyItems = Lists.newArrayList(packedValues);
|
||||||
copyOfDirtyItems.removeIf((data) -> data.id() == 8);
|
copyOfDirtyItems.removeIf((data) -> data.id() == 8);
|
||||||
|
|
||||||
@@ -432,7 +444,7 @@ public class ServerEntity {
|
@@ -434,7 +446,7 @@ public class ServerEntity {
|
||||||
|
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
this.trackedDataValues = datawatcher.getNonDefaultValues();
|
this.trackedDataValues = datawatcher.getNonDefaultValues();
|
||||||
@@ -203,10 +203,10 @@ index cce8f45c15b9a9acfbf9b769f7670cfd0969d62f..4237442c649845ffb0ff613e6c76ca47
|
|||||||
|
|
||||||
if (this.entity instanceof LivingEntity) {
|
if (this.entity instanceof LivingEntity) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 6e217474e7224cc5cc0a9818d39233c6757eca50..95137b2a064e98e476ef1bc56b0d2b2920f18d17 100644
|
index 495d8b5606457e9bfbe63199855dcd2140cd43f5..1b980864f8b10f172843b6ffce2673ffe899adbe 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -3418,7 +3418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -3465,7 +3465,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.entityData.markDirty(Entity.DATA_AIR_SUPPLY_ID);
|
this.entityData.markDirty(Entity.DATA_AIR_SUPPLY_ID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ index 6e217474e7224cc5cc0a9818d39233c6757eca50..95137b2a064e98e476ef1bc56b0d2b29
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index aae2093c42d76af5bdb0d4bda3e5ee362a2143e3..743aac4ba5d08ef3e6b67136bd4919b62411a7a0 100644
|
index d9668a752b06b560730973ebc82251d2cb8b7123..3e80788374f03269067137582f6b6816821f7cac 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -111,7 +111,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -111,7 +111,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
@@ -229,10 +229,10 @@ index aae2093c42d76af5bdb0d4bda3e5ee362a2143e3..743aac4ba5d08ef3e6b67136bd4919b6
|
|||||||
|
|
||||||
public BlockPos getStartPos() {
|
public BlockPos getStartPos() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 7a5ea7e0ea063eb0355dea89746a0e581548d131..90f10473ae441d68333cd497c718a3c982544533 100644
|
index 431b02599b7e3f2730841c8136460177aca37f3b..a2e8a95ba53953192db1889c686c507321666b03 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -189,7 +189,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -182,7 +182,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFuse(int fuse) {
|
public void setFuse(int fuse) {
|
||||||
@@ -242,10 +242,10 @@ index 7a5ea7e0ea063eb0355dea89746a0e581548d131..90f10473ae441d68333cd497c718a3c9
|
|||||||
|
|
||||||
public int getFuse() {
|
public int getFuse() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
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 567704f61034363e48ef2a5b5566ebdc91682297..74dcfabdc66ef289b8d6a5c6606579b5321af1db 100644
|
index 093d1388ff90ad59110a37536b6639f939549068..4d81892f890e144a69dfda7a118cbcb18004a3e0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -646,7 +646,7 @@ public abstract class Player extends LivingEntity {
|
@@ -645,7 +645,7 @@ public abstract class Player extends LivingEntity {
|
||||||
public void increaseScore(int score) {
|
public void increaseScore(int score) {
|
||||||
int j = this.getScore();
|
int j = this.getScore();
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Use Optimised TrackedEntityMap
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index bb6a2be67394b9a6904d759b7564008dd1c282b3..8a817dda325898b759de63ab6e4300b050286bf7 100644
|
index 0bfd2005dc82b0262badfe6867835e80a6e6a1dc..34fdb52904a26bc7c4c95eee91882a3924ab037c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -251,7 +251,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -254,7 +254,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
// Paper - rewrite chunk system
|
// Paper - rewrite chunk system
|
||||||
this.tickingGenerated = new AtomicInteger();
|
this.tickingGenerated = new AtomicInteger();
|
||||||
this.playerMap = new PlayerMap();
|
this.playerMap = new PlayerMap();
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise paper explosions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f250880b0c 100644
|
index 482609cb5395e626f7fc5890a6db3570c6a07166..0a9683c2005ab85708bfb6bbb051f68bed133918 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -111,6 +111,41 @@ public class Explosion {
|
@@ -112,6 +112,41 @@ public class Explosion {
|
||||||
this.yield = this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F; // CraftBukkit
|
this.yield = this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f2
|
|||||||
// Paper start - optimise collisions
|
// Paper start - optimise collisions
|
||||||
private static final double[] CACHED_RAYS;
|
private static final double[] CACHED_RAYS;
|
||||||
static {
|
static {
|
||||||
@@ -136,7 +171,7 @@ public class Explosion {
|
@@ -137,7 +172,7 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,16 +59,16 @@ index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f2
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final int CHUNK_CACHE_SHIFT = 2;
|
private static final int CHUNK_CACHE_SHIFT = 2;
|
||||||
@@ -430,7 +465,7 @@ public class Explosion {
|
@@ -431,7 +466,7 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.level.gameEvent(this.source, GameEvent.EXPLODE, new Vec3(this.x, this.y, this.z));
|
this.level.gameEvent(this.source, (Holder) GameEvent.EXPLODE, new Vec3(this.x, this.y, this.z));
|
||||||
- Set<BlockPos> set = Sets.newHashSet();
|
- Set<BlockPos> set = Sets.newHashSet();
|
||||||
+ // Sakura - moved into searchForBlocks
|
+ // Sakura - moved into searchForBlocks
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
@@ -456,6 +491,17 @@ public class Explosion {
|
@@ -457,6 +492,17 @@ public class Explosion {
|
||||||
|
|
||||||
initialCache = this.getOrCacheExplosionBlock(blockX, blockY, blockZ, key, true);
|
initialCache = this.getOrCacheExplosionBlock(blockX, blockY, blockZ, key, true);
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f2
|
|||||||
// only ~1/3rd of the loop iterations in vanilla will result in a ray, as it is iterating the perimeter of
|
// only ~1/3rd of the loop iterations in vanilla will result in a ray, as it is iterating the perimeter of
|
||||||
// a 16x16x16 cube
|
// a 16x16x16 cube
|
||||||
// we can cache the rays and their normals as well, so that we eliminate the excess iterations / checks and
|
// we can cache the rays and their normals as well, so that we eliminate the excess iterations / checks and
|
||||||
@@ -541,23 +587,63 @@ public class Explosion {
|
@@ -542,23 +588,63 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.toBlow.addAll(set);
|
this.toBlow.addAll(set);
|
||||||
@@ -158,7 +158,7 @@ index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f2
|
|||||||
if (!entity.ignoreExplosion(this)) {
|
if (!entity.ignoreExplosion(this)) {
|
||||||
double d7 = Math.sqrt(entity.distanceToSqr(vec3d)) / (double) f2;
|
double d7 = Math.sqrt(entity.distanceToSqr(vec3d)) / (double) f2;
|
||||||
|
|
||||||
@@ -581,24 +667,27 @@ public class Explosion {
|
@@ -582,24 +668,27 @@ public class Explosion {
|
||||||
// - Damaging EntityEnderDragon does nothing
|
// - Damaging EntityEnderDragon does nothing
|
||||||
// - EntityEnderDragon hitbock always covers the other parts and is therefore always present
|
// - EntityEnderDragon hitbock always covers the other parts and is therefore always present
|
||||||
if (entity instanceof EnderDragonPart) {
|
if (entity instanceof EnderDragonPart) {
|
||||||
@@ -191,7 +191,7 @@ index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f2
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
@@ -631,7 +720,7 @@ public class Explosion {
|
@@ -635,7 +724,7 @@ public class Explosion {
|
||||||
final org.bukkit.entity.Entity hitBy = this.damageSource.getEntity() != null ? this.damageSource.getEntity().getBukkitEntity() : this.source.getBukkitEntity();
|
final org.bukkit.entity.Entity hitBy = this.damageSource.getEntity() != null ? this.damageSource.getEntity().getBukkitEntity() : this.source.getBukkitEntity();
|
||||||
com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent paperEvent = new com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent(((LivingEntity) entity).getBukkitLivingEntity(), hitBy, (float) event.getForce(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(vec3d1));
|
com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent paperEvent = new com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent(((LivingEntity) entity).getBukkitLivingEntity(), hitBy, (float) event.getForce(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(vec3d1));
|
||||||
if (!paperEvent.callEvent()) {
|
if (!paperEvent.callEvent()) {
|
||||||
@@ -200,7 +200,7 @@ index 8fd87dc8f925a160bf390b05040110735f2a145b..e5335d64799005a4cdd2cb11cef637f2
|
|||||||
}
|
}
|
||||||
vec3d1 = org.bukkit.craftbukkit.util.CraftVector.toNMS(paperEvent.getAcceleration());
|
vec3d1 = org.bukkit.craftbukkit.util.CraftVector.toNMS(paperEvent.getAcceleration());
|
||||||
}
|
}
|
||||||
@@ -653,8 +742,12 @@ public class Explosion {
|
@@ -659,8 +748,12 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ index 0000000000000000000000000000000000000000..c9f2c5ae57878283e8c8bc3847fe63b9
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 95137b2a064e98e476ef1bc56b0d2b2920f18d17..e657b5f88195f1db2cb9a9a97f255ff23992cadd 100644
|
index 1b980864f8b10f172843b6ffce2673ffe899adbe..b87a07a5ac1da6803c7b61ef248a3dbecaedc3de 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -584,6 +584,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -586,6 +586,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
// Sakura end - load chunks on cannon entity movement
|
// Sakura end - load chunks on cannon entity movement
|
||||||
@@ -82,10 +82,10 @@ index 95137b2a064e98e476ef1bc56b0d2b2920f18d17..e657b5f88195f1db2cb9a9a97f255ff2
|
|||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index dc8d34adac1a2834777a8fe1fe7f142e0b13c0bf..684fd53a34fae43cd916a6f0a5cf38a2505d9bfe 100644
|
index 52c203dcc1e0ba6b0b236412dadfb1fed2a8ea31..a2a2747dbddb819cfd7d29a552824d9d88fca744 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1330,6 +1330,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1321,6 +1321,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) {
|
public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -169,10 +169,10 @@ index 0000000000000000000000000000000000000000..e63935c17e213bf60571d120ad9ce311
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3c98362624e1b02b6b028db95564254e044c7b0d..f78881fcf186c44da243c2f31ff855b878e172cf 100644
|
index 783367f380ad2a21418d102fbb6bc49a71148ee8..2db7dee8589425c805b148ef46827ce88ec38c4e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1748,6 +1748,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1807,6 +1807,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
||||||
worldserver.localConfig().expire(currentTickLong); // Sakura
|
worldserver.localConfig().expire(currentTickLong); // Sakura
|
||||||
worldserver.minimalTNT.clear(); // Sakura - visibility api
|
worldserver.minimalTNT.clear(); // Sakura - visibility api
|
||||||
@@ -181,10 +181,10 @@ index 3c98362624e1b02b6b028db95564254e044c7b0d..f78881fcf186c44da243c2f31ff855b8
|
|||||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 55e0be135ec084ee7ebe6bc7bb9323519e0cd864..51fa57e8b9d5c9ee563ec3608a437c69da08d32c 100644
|
index b97217662434b67a62f7247c2b5187749f207880..a9cfdbd7d138763584ee3d2825fe6979241422db 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -893,6 +893,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -899,6 +899,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
|
|
||||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||||
this.timings.entityTick.startTiming(); // Spigot
|
this.timings.entityTick.startTiming(); // Spigot
|
||||||
@@ -192,7 +192,7 @@ index 55e0be135ec084ee7ebe6bc7bb9323519e0cd864..51fa57e8b9d5c9ee563ec3608a437c69
|
|||||||
this.entityTickList.forEach((entity) -> {
|
this.entityTickList.forEach((entity) -> {
|
||||||
if (!entity.isRemoved()) {
|
if (!entity.isRemoved()) {
|
||||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||||
@@ -912,6 +913,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -918,6 +919,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
entity.stopRiding();
|
entity.stopRiding();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,10 +209,10 @@ index 55e0be135ec084ee7ebe6bc7bb9323519e0cd864..51fa57e8b9d5c9ee563ec3608a437c69
|
|||||||
this.guardEntityTick(this::tickNonPassenger, entity);
|
this.guardEntityTick(this::tickNonPassenger, entity);
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index e657b5f88195f1db2cb9a9a97f255ff23992cadd..a81dde7251255aa0966498c1c8449492dae537a9 100644
|
index b87a07a5ac1da6803c7b61ef248a3dbecaedc3de..1229a62c40ce0814addbb9e731fec348667d9d20 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -603,6 +603,117 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -605,6 +605,117 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return to.entityState() != null && to.entityState().isCurrentState(this);
|
return to.entityState() != null && to.entityState().isCurrentState(this);
|
||||||
}
|
}
|
||||||
// Sakura end - store entity data/state
|
// Sakura end - store entity data/state
|
||||||
@@ -330,15 +330,15 @@ index e657b5f88195f1db2cb9a9a97f255ff23992cadd..a81dde7251255aa0966498c1c8449492
|
|||||||
|
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
@@ -651,6 +762,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -654,6 +765,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.getEntityData().registrationLocked = true; // Spigot
|
this.entityData = datawatcher_a.build();
|
||||||
this.setPos(0.0D, 0.0D, 0.0D);
|
this.setPos(0.0D, 0.0D, 0.0D);
|
||||||
this.eyeHeight = this.getEyeHeight(net.minecraft.world.entity.Pose.STANDING, this.dimensions);
|
this.eyeHeight = this.dimensions.eyeHeight();
|
||||||
+ this.mergeLevel = level.sakuraConfig().cannons.mergeLevel; // Sakura
|
+ this.mergeLevel = level.sakuraConfig().cannons.mergeLevel; // Sakura
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isColliding(BlockPos pos, BlockState state) {
|
public boolean isColliding(BlockPos pos, BlockState state) {
|
||||||
@@ -2533,6 +2645,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -2592,6 +2704,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -350,7 +350,7 @@ index e657b5f88195f1db2cb9a9a97f255ff23992cadd..a81dde7251255aa0966498c1c8449492
|
|||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||||
@@ -2680,6 +2797,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -2739,6 +2856,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -362,7 +362,7 @@ index e657b5f88195f1db2cb9a9a97f255ff23992cadd..a81dde7251255aa0966498c1c8449492
|
|||||||
|
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||||
@@ -4889,6 +5011,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4944,6 +5066,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
CraftEventFactory.callEntityRemoveEvent(this, cause);
|
CraftEventFactory.callEntityRemoveEvent(this, cause);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -375,7 +375,7 @@ index e657b5f88195f1db2cb9a9a97f255ff23992cadd..a81dde7251255aa0966498c1c8449492
|
|||||||
if (this.removalReason == null) {
|
if (this.removalReason == null) {
|
||||||
this.removalReason = entity_removalreason;
|
this.removalReason = entity_removalreason;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 743aac4ba5d08ef3e6b67136bd4919b62411a7a0..99a0bec7eb5be527b41248b365b037a5e42a3270 100644
|
index 3e80788374f03269067137582f6b6816821f7cac..f3c0e3efdcdda4f9772499a7fdc78f0046e89a16 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -133,6 +133,59 @@ public class FallingBlockEntity extends Entity {
|
@@ -133,6 +133,59 @@ public class FallingBlockEntity extends Entity {
|
||||||
@@ -436,9 +436,9 @@ index 743aac4ba5d08ef3e6b67136bd4919b62411a7a0..99a0bec7eb5be527b41248b365b037a5
|
|||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
protected double getDefaultGravity() {
|
||||||
if (this.blockState.isAir()) {
|
return 0.04D;
|
||||||
@@ -200,6 +253,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -202,6 +255,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -447,10 +447,10 @@ index 743aac4ba5d08ef3e6b67136bd4919b62411a7a0..99a0bec7eb5be527b41248b365b037a5
|
|||||||
((ServerLevel) this.level()).getChunkSource().chunkMap.broadcast(this, new ClientboundBlockUpdatePacket(blockposition, this.level().getBlockState(blockposition)));
|
((ServerLevel) this.level()).getChunkSource().chunkMap.broadcast(this, new ClientboundBlockUpdatePacket(blockposition, this.level().getBlockState(blockposition)));
|
||||||
this.discard(EntityRemoveEvent.Cause.DESPAWN);
|
this.discard(EntityRemoveEvent.Cause.DESPAWN);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 90f10473ae441d68333cd497c718a3c982544533..4f695305794c2564517d99b4edd3180d7ea07845 100644
|
index a2e8a95ba53953192db1889c686c507321666b03..1860ffd3e11601983abbb85962dd9ef56992c9f5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -72,6 +72,44 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -70,6 +70,44 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
return !this.isRemoved();
|
return !this.isRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,8 +493,8 @@ index 90f10473ae441d68333cd497c718a3c982544533..4f695305794c2564517d99b4edd3180d
|
|||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
protected double getDefaultGravity() {
|
||||||
if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
return 0.04D;
|
||||||
@@ -97,6 +135,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -97,6 +135,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
if (i <= 0) {
|
if (i <= 0) {
|
||||||
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
|
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
|
||||||
@@ -504,10 +504,10 @@ index 90f10473ae441d68333cd497c718a3c982544533..4f695305794c2564517d99b4edd3180d
|
|||||||
this.explode();
|
this.explode();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 684fd53a34fae43cd916a6f0a5cf38a2505d9bfe..9507b2419834ace4f71a781ad90284af5e4d8aa1 100644
|
index a2a2747dbddb819cfd7d29a552824d9d88fca744..1b14de4b22bd6f7103be55af20df6f5d7a149e0b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -229,6 +229,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -226,6 +226,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
|
|
||||||
public final it.unimi.dsi.fastutil.longs.Long2IntMap minimalTNT = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); // Sakura - visibility api
|
public final it.unimi.dsi.fastutil.longs.Long2IntMap minimalTNT = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); // Sakura - visibility api
|
||||||
|
|||||||
@@ -129,10 +129,10 @@ index 0000000000000000000000000000000000000000..d7e24638f07f243502004970ab4ce646
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index f78881fcf186c44da243c2f31ff855b878e172cf..62d54547fc8c1a9f7b19a2020b754a189ba7c52f 100644
|
index 2db7dee8589425c805b148ef46827ce88ec38c4e..69b972a5b1ad62f1cfa759fd2e0d371a8745539b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1749,6 +1749,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1808,6 +1808,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
worldserver.localConfig().expire(currentTickLong); // Sakura
|
worldserver.localConfig().expire(currentTickLong); // Sakura
|
||||||
worldserver.minimalTNT.clear(); // Sakura - visibility api
|
worldserver.minimalTNT.clear(); // Sakura - visibility api
|
||||||
worldserver.mergeHistory.expire(currentTickLong); // Sakura - merge cannoning entities
|
worldserver.mergeHistory.expire(currentTickLong); // Sakura - merge cannoning entities
|
||||||
@@ -141,10 +141,10 @@ index f78881fcf186c44da243c2f31ff855b878e172cf..62d54547fc8c1a9f7b19a2020b754a18
|
|||||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index e5335d64799005a4cdd2cb11cef637f250880b0c..e2d9d00427d35a21a4fc6804f5cd426ab58dce44 100644
|
index 0a9683c2005ab85708bfb6bbb051f68bed133918..ead8ddd7fd9941d4349b9b94ad313bf9d46bdc0b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -400,7 +400,12 @@ public class Explosion {
|
@@ -401,7 +401,12 @@ public class Explosion {
|
||||||
Math.fma(dz, diffZ, offZ)
|
Math.fma(dz, diffZ, offZ)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ index e5335d64799005a4cdd2cb11cef637f250880b0c..e2d9d00427d35a21a4fc6804f5cd426a
|
|||||||
++missedRays;
|
++missedRays;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,7 +440,16 @@ public class Explosion {
|
@@ -436,7 +441,16 @@ public class Explosion {
|
||||||
double d10 = Mth.lerp(d7, axisalignedbb.minZ, axisalignedbb.maxZ);
|
double d10 = Mth.lerp(d7, axisalignedbb.minZ, axisalignedbb.maxZ);
|
||||||
Vec3 vec3d1 = new Vec3(d8 + d3, d9, d10 + d4);
|
Vec3 vec3d1 = new Vec3(d8 + d3, d9, d10 + d4);
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ index e5335d64799005a4cdd2cb11cef637f250880b0c..e2d9d00427d35a21a4fc6804f5cd426a
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -841,6 +855,11 @@ public class Explosion {
|
@@ -849,6 +863,11 @@ public class Explosion {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ index e5335d64799005a4cdd2cb11cef637f250880b0c..e2d9d00427d35a21a4fc6804f5cd426a
|
|||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -965,14 +984,12 @@ public class Explosion {
|
@@ -973,14 +992,12 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
// Paper start - Optimize explosions
|
// Paper start - Optimize explosions
|
||||||
private float getBlockDensity(Vec3 vec3d, Entity entity, ExplosionBlockCache[] blockCache, BlockPos.MutableBlockPos blockPos) { // Paper - optimise explosions
|
private float getBlockDensity(Vec3 vec3d, Entity entity, ExplosionBlockCache[] blockCache, BlockPos.MutableBlockPos blockPos) { // Paper - optimise explosions
|
||||||
@@ -209,10 +209,10 @@ index e5335d64799005a4cdd2cb11cef637f250880b0c..e2d9d00427d35a21a4fc6804f5cd426a
|
|||||||
|
|
||||||
return blockDensity;
|
return blockDensity;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 9507b2419834ace4f71a781ad90284af5e4d8aa1..d555ea21a6e53938003a45d5de2ce97c4986f9e7 100644
|
index 1b14de4b22bd6f7103be55af20df6f5d7a149e0b..e53f3b508eba942a6d61c1ad678ff0f5793c3f73 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -230,6 +230,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -227,6 +227,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
public final it.unimi.dsi.fastutil.longs.Long2IntMap minimalTNT = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); // Sakura - visibility api
|
public final it.unimi.dsi.fastutil.longs.Long2IntMap minimalTNT = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); // Sakura - visibility api
|
||||||
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
||||||
@@ -221,10 +221,10 @@ index 9507b2419834ace4f71a781ad90284af5e4d8aa1..d555ea21a6e53938003a45d5de2ce97c
|
|||||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, Supplier<me.samsuik.sakura.configuration.WorldConfiguration> sakuraWorldConfigCreator, java.util.concurrent.Executor executor) { // Sakura // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, Supplier<me.samsuik.sakura.configuration.WorldConfiguration> sakuraWorldConfigCreator, java.util.concurrent.Executor executor) { // Sakura // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
||||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
||||||
index 0d573c05f4f8838d4492f749ca473f7a9e8d60dd..88c2c2d9fbda662509b57535c718a0cb7aa72918 100644
|
index 8b33e35c843e5c0b8988a2ef2a38a2673035292f..5ec557652558bb44e9be7d32fc214091d29aac78 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
||||||
@@ -108,6 +108,11 @@ public abstract class BasePressurePlateBlock extends Block {
|
@@ -109,6 +109,11 @@ public abstract class BasePressurePlateBlock extends Block {
|
||||||
if (output != j) {
|
if (output != j) {
|
||||||
BlockState iblockdata1 = this.setSignalForState(state, j);
|
BlockState iblockdata1 = this.setSignalForState(state, j);
|
||||||
|
|
||||||
@@ -237,10 +237,10 @@ index 0d573c05f4f8838d4492f749ca473f7a9e8d60dd..88c2c2d9fbda662509b57535c718a0cb
|
|||||||
this.updateNeighbours(world, pos);
|
this.updateNeighbours(world, pos);
|
||||||
world.setBlocksDirty(pos, state, iblockdata1);
|
world.setBlocksDirty(pos, state, iblockdata1);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
index efd8d77a441fd334ea4c09c5e31c6d946c1ae0b7..b3ff822f97237be81edba4fc5aa90121307ede0b 100644
|
index 76aca266d3f3222502ff4c196228f08fcd88c5f8..6a63e60d80ee53a4611dfcdd9ab974f8227fae59 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
@@ -172,6 +172,11 @@ public class TripWireHookBlock extends Block {
|
@@ -173,6 +173,11 @@ public class TripWireHookBlock extends Block {
|
||||||
blockposition1 = pos.relative(enumdirection, j);
|
blockposition1 = pos.relative(enumdirection, j);
|
||||||
Direction enumdirection1 = enumdirection.getOpposite();
|
Direction enumdirection1 = enumdirection.getOpposite();
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise explosions in protected regions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 55f3f6bd77976f1ba4f7ac820a0333f1df82ab4d..fa1a06e6455390c3c945d988a3d4ee9a9ea92d38 100644
|
index ead8ddd7fd9941d4349b9b94ad313bf9d46bdc0b..d7e8dd148098de080c5bc0f76b36207501e1089f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -415,6 +415,21 @@ public class Explosion {
|
@@ -416,6 +416,21 @@ public class Explosion {
|
||||||
return (float)missedRays / (float)totalRays;
|
return (float)missedRays / (float)totalRays;
|
||||||
}
|
}
|
||||||
// Paper end - optimise collisions
|
// Paper end - optimise collisions
|
||||||
@@ -30,7 +30,7 @@ index 55f3f6bd77976f1ba4f7ac820a0333f1df82ab4d..fa1a06e6455390c3c945d988a3d4ee9a
|
|||||||
|
|
||||||
private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity entity) {
|
private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity entity) {
|
||||||
return (ExplosionDamageCalculator) (entity == null ? Explosion.EXPLOSION_DAMAGE_CALCULATOR : new EntityBasedExplosionDamageCalculator(entity));
|
return (ExplosionDamageCalculator) (entity == null ? Explosion.EXPLOSION_DAMAGE_CALCULATOR : new EntityBasedExplosionDamageCalculator(entity));
|
||||||
@@ -506,7 +521,7 @@ public class Explosion {
|
@@ -507,7 +522,7 @@ public class Explosion {
|
||||||
initialCache = this.getOrCacheExplosionBlock(blockX, blockY, blockZ, key, true);
|
initialCache = this.getOrCacheExplosionBlock(blockX, blockY, blockZ, key, true);
|
||||||
}
|
}
|
||||||
// Sakura start - optimise paper explosions
|
// Sakura start - optimise paper explosions
|
||||||
|
|||||||
@@ -23,14 +23,15 @@ index 0fd814f1d65c111266a2b20f86561839a4cef755..932f7a0d030d2d4932e6e6d4a5805e9b
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..929231896288c8355c17ba878d3dc296e9b258da
|
index 0000000000000000000000000000000000000000..688a2bbd0b0b60b9acbdb3e6da0b24efed2bfde9
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
||||||
@@ -0,0 +1,197 @@
|
@@ -0,0 +1,198 @@
|
||||||
+package me.samsuik.sakura.explosion.special;
|
+package me.samsuik.sakura.explosion.special;
|
||||||
+
|
+
|
||||||
+import io.papermc.paper.util.WorldUtil;
|
+import io.papermc.paper.util.WorldUtil;
|
||||||
+import net.minecraft.core.BlockPos;
|
+import net.minecraft.core.BlockPos;
|
||||||
|
+import net.minecraft.core.Holder;
|
||||||
+import net.minecraft.core.particles.ParticleOptions;
|
+import net.minecraft.core.particles.ParticleOptions;
|
||||||
+import net.minecraft.server.level.ServerLevel;
|
+import net.minecraft.server.level.ServerLevel;
|
||||||
+import net.minecraft.sounds.SoundEvent;
|
+import net.minecraft.sounds.SoundEvent;
|
||||||
@@ -58,7 +59,7 @@ index 0000000000000000000000000000000000000000..929231896288c8355c17ba878d3dc296
|
|||||||
+ protected ExplosionBlockCache[] recentBlockCache;
|
+ protected ExplosionBlockCache[] recentBlockCache;
|
||||||
+ protected final BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();
|
+ protected final BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();
|
||||||
+
|
+
|
||||||
+ public SpecialisedExplosion(Level world, T entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, SoundEvent soundEvent) {
|
+ public SpecialisedExplosion(Level world, T entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, Holder<SoundEvent> soundEvent) {
|
||||||
+ super(world, entity, damageSource, behavior, x, y, z, power, createFire, destructionType, particle, emitterParticle, soundEvent);
|
+ super(world, entity, damageSource, behavior, x, y, z, power, createFire, destructionType, particle, emitterParticle, soundEvent);
|
||||||
+ this.level = (ServerLevel) world;
|
+ this.level = (ServerLevel) world;
|
||||||
+ this.position = new Vec3(x, y, z);
|
+ this.position = new Vec3(x, y, z);
|
||||||
@@ -226,10 +227,10 @@ index 0000000000000000000000000000000000000000..929231896288c8355c17ba878d3dc296
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..b94861d545cefb0e68a83efa6812a1ff4a381027
|
index 0000000000000000000000000000000000000000..71e1774a6db949ad6c01f1283a17a89ae6af8b02
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
||||||
@@ -0,0 +1,179 @@
|
@@ -0,0 +1,180 @@
|
||||||
+package me.samsuik.sakura.explosion.special;
|
+package me.samsuik.sakura.explosion.special;
|
||||||
+
|
+
|
||||||
+import io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet;
|
+import io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet;
|
||||||
@@ -237,6 +238,7 @@ index 0000000000000000000000000000000000000000..b94861d545cefb0e68a83efa6812a1ff
|
|||||||
+import me.samsuik.sakura.entity.EntityState;
|
+import me.samsuik.sakura.entity.EntityState;
|
||||||
+import net.minecraft.core.BlockPos;
|
+import net.minecraft.core.BlockPos;
|
||||||
+import net.minecraft.core.Direction;
|
+import net.minecraft.core.Direction;
|
||||||
|
+import net.minecraft.core.Holder;
|
||||||
+import net.minecraft.core.particles.ParticleOptions;
|
+import net.minecraft.core.particles.ParticleOptions;
|
||||||
+import net.minecraft.sounds.SoundEvent;
|
+import net.minecraft.sounds.SoundEvent;
|
||||||
+import net.minecraft.util.Mth;
|
+import net.minecraft.util.Mth;
|
||||||
@@ -262,7 +264,7 @@ index 0000000000000000000000000000000000000000..b94861d545cefb0e68a83efa6812a1ff
|
|||||||
+ private int wrapped = 0;
|
+ private int wrapped = 0;
|
||||||
+ private int movement = 0;
|
+ private int movement = 0;
|
||||||
+
|
+
|
||||||
+ public TntExplosion(Level world, PrimedTnt tnt, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, SoundEvent soundEvent) {
|
+ public TntExplosion(Level world, PrimedTnt tnt, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, Holder<SoundEvent> soundEvent) {
|
||||||
+ super(world, tnt, damageSource, behavior, x, y, z, power, createFire, destructionType, particle, emitterParticle, soundEvent);
|
+ super(world, tnt, damageSource, behavior, x, y, z, power, createFire, destructionType, particle, emitterParticle, soundEvent);
|
||||||
+ this.originalPosition = this.position;
|
+ this.originalPosition = this.position;
|
||||||
+ this.bounds = new AABB(x, y, z, x, y, z);
|
+ this.bounds = new AABB(x, y, z, x, y, z);
|
||||||
@@ -410,10 +412,10 @@ index 0000000000000000000000000000000000000000..b94861d545cefb0e68a83efa6812a1ff
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 51fa57e8b9d5c9ee563ec3608a437c69da08d32c..ec7d7f22b267ae6572e6005f10221755cbb1a480 100644
|
index a9cfdbd7d138763584ee3d2825fe6979241422db..3ca19140d8c7b28f73e80dcdbfd60536d74886ff 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1957,6 +1957,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1964,6 +1964,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
explosion.clearToBlow();
|
explosion.clearToBlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,7 +428,7 @@ index 51fa57e8b9d5c9ee563ec3608a437c69da08d32c..ec7d7f22b267ae6572e6005f10221755
|
|||||||
Iterator iterator = this.players.iterator();
|
Iterator iterator = this.players.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -1967,7 +1973,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1974,7 +1980,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,10 +438,10 @@ index 51fa57e8b9d5c9ee563ec3608a437c69da08d32c..ec7d7f22b267ae6572e6005f10221755
|
|||||||
|
|
||||||
@Override
|
@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
|
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 4f695305794c2564517d99b4edd3180d7ea07845..8acef487b0579febb3497cc88b23c4fc74492571 100644
|
index 1860ffd3e11601983abbb85962dd9ef56992c9f5..f8e19ca5af5b313e887ce8b428e32a84a26a8927 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -86,28 +86,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -84,28 +84,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
&& (tnt.entityState().fallDistance() == fallDistance
|
&& (tnt.entityState().fallDistance() == fallDistance
|
||||||
|| tnt.entityState().fallDistance() > 2.5f && fallDistance > 2.5f);
|
|| tnt.entityState().fallDistance() > 2.5f && fallDistance > 2.5f);
|
||||||
}
|
}
|
||||||
@@ -470,10 +472,10 @@ index 4f695305794c2564517d99b4edd3180d7ea07845..8acef487b0579febb3497cc88b23c4fc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index c9cf9373d3eae4e54ae27fbb8993f858e91e98cc..8e80e602368d784a64c68a061505d4e08997566b 100644
|
index d7e8dd148098de080c5bc0f76b36207501e1089f..7eb8da4075b4f1706f698a0b48206421bf4353c3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -55,9 +55,11 @@ public class Explosion {
|
@@ -56,9 +56,11 @@ public class Explosion {
|
||||||
private final Explosion.BlockInteraction blockInteraction;
|
private final Explosion.BlockInteraction blockInteraction;
|
||||||
private final RandomSource random;
|
private final RandomSource random;
|
||||||
private final Level level;
|
private final Level level;
|
||||||
@@ -488,7 +490,7 @@ index c9cf9373d3eae4e54ae27fbb8993f858e91e98cc..8e80e602368d784a64c68a061505d4e0
|
|||||||
@Nullable
|
@Nullable
|
||||||
public final Entity source;
|
public final Entity source;
|
||||||
private final float radius;
|
private final float radius;
|
||||||
@@ -185,7 +187,7 @@ public class Explosion {
|
@@ -186,7 +188,7 @@ public class Explosion {
|
||||||
// resistance = (res + 0.3F) * 0.3F;
|
// resistance = (res + 0.3F) * 0.3F;
|
||||||
// so for resistance = 0, we need res = -0.3F
|
// so for resistance = 0, we need res = -0.3F
|
||||||
private static final Float ZERO_RESISTANCE = Float.valueOf(-0.3f);
|
private static final Float ZERO_RESISTANCE = Float.valueOf(-0.3f);
|
||||||
@@ -497,7 +499,7 @@ index c9cf9373d3eae4e54ae27fbb8993f858e91e98cc..8e80e602368d784a64c68a061505d4e0
|
|||||||
|
|
||||||
public static final class ExplosionBlockCache {
|
public static final class ExplosionBlockCache {
|
||||||
|
|
||||||
@@ -212,7 +214,29 @@ public class Explosion {
|
@@ -213,7 +215,29 @@ public class Explosion {
|
||||||
private long[] chunkPosCache = null;
|
private long[] chunkPosCache = null;
|
||||||
private net.minecraft.world.level.chunk.LevelChunk[] chunkCache = null;
|
private net.minecraft.world.level.chunk.LevelChunk[] chunkCache = null;
|
||||||
|
|
||||||
@@ -528,7 +530,7 @@ index c9cf9373d3eae4e54ae27fbb8993f858e91e98cc..8e80e602368d784a64c68a061505d4e0
|
|||||||
final long key, final boolean calculateResistance) {
|
final long key, final boolean calculateResistance) {
|
||||||
ExplosionBlockCache ret = this.blockCache.get(key);
|
ExplosionBlockCache ret = this.blockCache.get(key);
|
||||||
if (ret != null) {
|
if (ret != null) {
|
||||||
@@ -501,14 +525,7 @@ public class Explosion {
|
@@ -502,14 +526,7 @@ public class Explosion {
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
// Paper start - optimise explosions
|
// Paper start - optimise explosions
|
||||||
@@ -544,7 +546,7 @@ index c9cf9373d3eae4e54ae27fbb8993f858e91e98cc..8e80e602368d784a64c68a061505d4e0
|
|||||||
// use initial cache value that is most likely to be used: the source position
|
// use initial cache value that is most likely to be used: the source position
|
||||||
final ExplosionBlockCache initialCache;
|
final ExplosionBlockCache initialCache;
|
||||||
{
|
{
|
||||||
@@ -998,7 +1015,7 @@ public class Explosion {
|
@@ -1006,7 +1023,7 @@ public class Explosion {
|
||||||
private BlockInteraction() {}
|
private BlockInteraction() {}
|
||||||
}
|
}
|
||||||
// Paper start - Optimize explosions
|
// Paper start - Optimize explosions
|
||||||
@@ -554,10 +556,10 @@ index c9cf9373d3eae4e54ae27fbb8993f858e91e98cc..8e80e602368d784a64c68a061505d4e0
|
|||||||
float blockDensity = this.level.densityCache.getDensity(vec3d, entity);
|
float blockDensity = this.level.densityCache.getDensity(vec3d, entity);
|
||||||
if (blockDensity == me.samsuik.sakura.explosion.density.BlockDensityCache.UNKNOWN_DENSITY) {
|
if (blockDensity == me.samsuik.sakura.explosion.density.BlockDensityCache.UNKNOWN_DENSITY) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index d555ea21a6e53938003a45d5de2ce97c4986f9e7..ad4076dd0352eb4f62588e3c83ffb2c42b07a3e0 100644
|
index e53f3b508eba942a6d61c1ad678ff0f5793c3f73..4553c252d3dd0a9413319a7a5dd5cce201b0fa72 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1419,7 +1419,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1415,7 +1415,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
Explosion.BlockInteraction explosion_effect1 = explosion_effect;
|
Explosion.BlockInteraction explosion_effect1 = explosion_effect;
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise Fast Movement
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index a81dde7251255aa0966498c1c8449492dae537a9..08a5558679da5602f05f2f052cb841d008d866cc 100644
|
index 1229a62c40ce0814addbb9e731fec348667d9d20..7b9576ef915a414026f8b358ed409a12103ef6fb 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1236,6 +1236,95 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1278,6 +1278,95 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
// Paper end - detailed watchdog information
|
// Paper end - detailed watchdog information
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ index a81dde7251255aa0966498c1c8449492dae537a9..08a5558679da5602f05f2f052cb841d0
|
|||||||
public void move(MoverType movementType, Vec3 movement) {
|
public void move(MoverType movementType, Vec3 movement) {
|
||||||
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
||||||
// Paper start - detailed watchdog information
|
// Paper start - detailed watchdog information
|
||||||
@@ -1614,6 +1703,95 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1656,6 +1745,95 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return offsetFactor;
|
return offsetFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,26 +201,26 @@ index a81dde7251255aa0966498c1c8449492dae537a9..08a5558679da5602f05f2f052cb841d0
|
|||||||
// Paper start - optimise collisions
|
// Paper start - optimise collisions
|
||||||
final boolean xZero = movement.x == 0.0;
|
final boolean xZero = movement.x == 0.0;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 99a0bec7eb5be527b41248b365b037a5e42a3270..16a8b667f50700a85f1c14f3a7ed3098e732321a 100644
|
index f3c0e3efdcdda4f9772499a7fdc78f0046e89a16..ee38d2a82f9f0056ebb6579868df8c4709cd7b41 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -198,7 +198,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -200,7 +200,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
|
++this.time;
|
||||||
|
this.applyGravity();
|
||||||
- this.move(MoverType.SELF, this.getDeltaMovement());
|
- this.move(MoverType.SELF, this.getDeltaMovement());
|
||||||
+ this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
+ this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
||||||
// Paper start - Configurable falling blocks height nerf
|
// Paper start - Configurable falling blocks height nerf
|
||||||
if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
|
if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
|
||||||
if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 30c3e31148d23998ce9007691c30d1d518a2b86d..491dab62dda6e24bda5b01364a2adbf51ad74ef6 100644
|
index f8e19ca5af5b313e887ce8b428e32a84a26a8927..85b2cfd067c71eed3a5a8007ed6e933e9609f94d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -96,7 +96,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -96,7 +96,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
public void tick() {
|
||||||
}
|
if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
||||||
|
this.applyGravity();
|
||||||
- this.move(MoverType.SELF, this.getDeltaMovement());
|
- this.move(MoverType.SELF, this.getDeltaMovement());
|
||||||
+ this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
+ this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
||||||
// Paper start - Configurable TNT height nerf
|
// Paper start - Configurable TNT height nerf
|
||||||
|
|||||||
@@ -329,10 +329,10 @@ index 8fcaa00e461c7f4413bf655ddd8165a2b908f900..404b99def4562942e036089085a66797
|
|||||||
if (this.count == 0) {
|
if (this.count == 0) {
|
||||||
return;
|
return;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index ad4076dd0352eb4f62588e3c83ffb2c42b07a3e0..360e72b8e540f3cdb557bc59bca5e0a9cda239f8 100644
|
index 4553c252d3dd0a9413319a7a5dd5cce201b0fa72..1a150fc2e875860ed25dcda99394c8809d87bb04 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -232,6 +232,39 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -229,6 +229,39 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
||||||
public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(); // Sakura - explosion density cache
|
public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(); // Sakura - explosion density cache
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] isPushedByFluid API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 08a5558679da5602f05f2f052cb841d008d866cc..24dcf92c85d4453564d3ca51687a59497d8182fe 100644
|
index 7b9576ef915a414026f8b358ed409a12103ef6fb..3b0eecdac7eb63f3bf25af3db107cc6944fb672c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -714,6 +714,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -716,6 +716,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sakura end - cannon entity merging
|
// Sakura end - cannon entity merging
|
||||||
@@ -16,7 +16,7 @@ index 08a5558679da5602f05f2f052cb841d008d866cc..24dcf92c85d4453564d3ca51687a5949
|
|||||||
|
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
@@ -4252,7 +4253,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4301,7 +4302,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPushedByFluid() {
|
public boolean isPushedByFluid() {
|
||||||
@@ -26,7 +26,7 @@ index 08a5558679da5602f05f2f052cb841d008d866cc..24dcf92c85d4453564d3ca51687a5949
|
|||||||
|
|
||||||
public static double getViewScale() {
|
public static double getViewScale() {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index e8e4489bcd64fde1b3226bdc7a7cc612508bda3f..4731d10dd5e493af9564d38d8bf1ff223390bd75 100644
|
index a2d336ceb52b63db5c03432ee7bc94dc6a742b82..b51f8f2975918db3a510cb64a93bdb935b8e7510 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@@ -201,6 +201,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@@ -201,6 +201,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Cannon Mechanics
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 16a8b667f50700a85f1c14f3a7ed3098e732321a..fd7524b3aae54bc62dce1c54666f18ad0ea230b4 100644
|
index ee38d2a82f9f0056ebb6579868df8c4709cd7b41..fe21305f66cc60e2036d2023f5f49e4a23e014dc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -68,6 +68,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -68,6 +68,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
@@ -36,12 +36,12 @@ index 16a8b667f50700a85f1c14f3a7ed3098e732321a..fd7524b3aae54bc62dce1c54666f18ad
|
|||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
protected double getDefaultGravity() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 491dab62dda6e24bda5b01364a2adbf51ad74ef6..403cfb14dff46a405a1476f6806020e9a2c9a941 100644
|
index 85b2cfd067c71eed3a5a8007ed6e933e9609f94d..469bc508416ae44546c655a23d9bc2572078ccb5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -54,6 +54,12 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -52,6 +52,12 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
this.yo = y;
|
this.yo = y;
|
||||||
this.zo = z;
|
this.zo = z;
|
||||||
this.owner = igniter;
|
this.owner = igniter;
|
||||||
@@ -54,7 +54,7 @@ index 491dab62dda6e24bda5b01364a2adbf51ad74ef6..403cfb14dff46a405a1476f6806020e9
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -225,7 +231,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -218,7 +224,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
// Paper start - Option to prevent TNT from moving in water
|
// Paper start - Option to prevent TNT from moving in water
|
||||||
@Override
|
@Override
|
||||||
public boolean isPushedByFluid() {
|
public boolean isPushedByFluid() {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache MovingBlockEntity collision shape
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
index 9f45dda6ff45ac1ffb7ac99575b7d09bdc61c56a..c89e1fe5fafac46d82b2b20d27586c6997ce8906 100644
|
index b35f476e26a020cf75e53a5eb488717d996a6935..d555ad1dd2f648b84920eceec6cc99e8801334b3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
@@ -41,6 +41,11 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -42,6 +42,11 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
private float progressO;
|
private float progressO;
|
||||||
private long lastTicked;
|
private long lastTicked;
|
||||||
private int deathTicks;
|
private int deathTicks;
|
||||||
@@ -20,7 +20,7 @@ index 9f45dda6ff45ac1ffb7ac99575b7d09bdc61c56a..c89e1fe5fafac46d82b2b20d27586c69
|
|||||||
|
|
||||||
public PistonMovingBlockEntity(BlockPos pos, BlockState state) {
|
public PistonMovingBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(BlockEntityType.PISTON, pos, state);
|
super(BlockEntityType.PISTON, pos, state);
|
||||||
@@ -348,6 +353,18 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -349,6 +354,18 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public VoxelShape getCollisionShape(BlockGetter world, BlockPos pos) {
|
public VoxelShape getCollisionShape(BlockGetter world, BlockPos pos) {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise TNT fluid state and pushing
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 24dcf92c85d4453564d3ca51687a59497d8182fe..e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850 100644
|
index 3b0eecdac7eb63f3bf25af3db107cc6944fb672c..f3b264f38b8978a18b8849476ca31e96f38272a4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2199,7 +2199,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -2258,7 +2258,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return this.isInWater() || flag;
|
return this.isInWater() || flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,12 +16,12 @@ index 24dcf92c85d4453564d3ca51687a59497d8182fe..e3b6ef30a3c983e7e9b6bd83bc7baa60
|
|||||||
+ protected void updateInWaterStateAndDoWaterCurrentPushing() { // Sakura
|
+ protected void updateInWaterStateAndDoWaterCurrentPushing() { // Sakura
|
||||||
Entity entity = this.getVehicle();
|
Entity entity = this.getVehicle();
|
||||||
|
|
||||||
if (entity instanceof Boat) {
|
if (entity instanceof Boat entityboat) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 403cfb14dff46a405a1476f6806020e9a2c9a941..b4b509bcdd470ff21bbe6e0c3f58848c168bc120 100644
|
index 469bc508416ae44546c655a23d9bc2572078ccb5..bfe1b2debf94c54f923daf81ad51a7e9ca92d3d1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -94,6 +94,19 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -92,6 +92,19 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
}
|
}
|
||||||
// Sakura - specialised explosions
|
// Sakura - specialised explosions
|
||||||
// Sakura end
|
// Sakura end
|
||||||
@@ -40,4 +40,4 @@ index 403cfb14dff46a405a1476f6806020e9a2c9a941..b4b509bcdd470ff21bbe6e0c3f58848c
|
|||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
protected double getDefaultGravity() {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise LivingEntity#pushEntities
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index e9bb7feb591032904516d1b9374f486d8a7d066c..6162631e863dd15c7fdb70dbde2f85d273c7020b 100644
|
index 6e043457a29a890bcefd27fc5bb07c1a7e4e30f7..361b6fd6cae71a5c079c9dd9d8224f10c30cbf80 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3580,7 +3580,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -3570,7 +3570,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end - don't run getEntities if we're not going to use its result
|
// Paper end - don't run getEntities if we're not going to use its result
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Despawn falling blocks inside moving pistons
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index fd7524b3aae54bc62dce1c54666f18ad0ea230b4..7bfbdfd4c61941eb6a95ceeb8face277b31735eb 100644
|
index fe21305f66cc60e2036d2023f5f49e4a23e014dc..b1193e2d8b43e66cc5a5a03bcc0e77577d98b863 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -232,7 +232,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -234,7 +234,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Configure Entity Knockback
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 6162631e863dd15c7fdb70dbde2f85d273c7020b..e75322367764805443f9a9f5639d804b87a0ab5e 100644
|
index 361b6fd6cae71a5c079c9dd9d8224f10c30cbf80..1766a599850a674a00ba26afe231c0982a6cb653 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -1549,7 +1549,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1568,7 +1568,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
d0 = (Math.random() - Math.random()) * 0.01D;
|
d0 = (Math.random() - Math.random()) * 0.01D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ index 6162631e863dd15c7fdb70dbde2f85d273c7020b..e75322367764805443f9a9f5639d804b
|
|||||||
if (!flag) {
|
if (!flag) {
|
||||||
this.indicateDamage(d0, d1);
|
this.indicateDamage(d0, d1);
|
||||||
}
|
}
|
||||||
@@ -1596,7 +1596,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1622,7 +1622,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void blockedByShield(LivingEntity target) {
|
protected void blockedByShield(LivingEntity target) {
|
||||||
@@ -26,7 +26,7 @@ index 6162631e863dd15c7fdb70dbde2f85d273c7020b..e75322367764805443f9a9f5639d804b
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkTotemDeathProtection(DamageSource source) {
|
private boolean checkTotemDeathProtection(DamageSource source) {
|
||||||
@@ -1914,13 +1914,26 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1940,13 +1940,26 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void knockback(double d0, double d1, double d2, @Nullable Entity attacker, EntityKnockbackEvent.KnockbackCause cause) { // Paper - add nullable to attacker param
|
public void knockback(double d0, double d1, double d2, @Nullable Entity attacker, EntityKnockbackEvent.KnockbackCause cause) { // Paper - add nullable to attacker param
|
||||||
@@ -56,55 +56,46 @@ index 6162631e863dd15c7fdb70dbde2f85d273c7020b..e75322367764805443f9a9f5639d804b
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
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 74dcfabdc66ef289b8d6a5c6606579b5321af1db..94577ca6de11d23d2a2561b645212a7717088974 100644
|
index 4d81892f890e144a69dfda7a118cbcb18004a3e0..e039212df79a22a46a87b518ced8b01b067e0153 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -183,6 +183,7 @@ public abstract class Player extends LivingEntity {
|
@@ -195,6 +195,7 @@ public abstract class Player extends LivingEntity {
|
||||||
public float hurtDir; // Paper - protected -> public
|
public boolean ignoreFallDamageFromCurrentImpulse;
|
||||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
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
|
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||||
+ private long lastSprintKnockback = -1; // Sakura - configure entity knockback
|
+ private long lastSprintKnockback = -1; // Sakura - configure entity knockback
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public boolean fauxSleeping;
|
public boolean fauxSleeping;
|
||||||
@@ -1274,7 +1275,7 @@ public abstract class Player extends LivingEntity {
|
@@ -1340,10 +1341,20 @@ public abstract class Player extends LivingEntity {
|
||||||
byte b0 = 0;
|
|
||||||
int i = b0 + EnchantmentHelper.getKnockbackBonus(this);
|
|
||||||
|
|
||||||
- if (this.isSprinting() && flag) {
|
if (flag5) {
|
||||||
+ if (this.isSprinting() && (!level().sakuraConfig().players.knockback.sprinting.requireFullAttack || flag)) { // Sakura
|
if (i > 0) {
|
||||||
sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
|
+ // Sakura start - configure extra sprinting knockback
|
||||||
++i;
|
+ float extraKnockback = (float) i * 0.5F;
|
||||||
flag1 = true;
|
+ long millis = System.currentTimeMillis();
|
||||||
@@ -1324,10 +1325,20 @@ public abstract class Player extends LivingEntity {
|
+ long sinceLastKnockback = millis - this.lastSprintKnockback;
|
||||||
|
|
||||||
if (flag5) {
|
|
||||||
if (i > 0) {
|
|
||||||
+ // Sakura start - configure extra sprinting knockback
|
|
||||||
+ float extraKnockback = (float) i * 0.5F;
|
|
||||||
+ long millis = System.currentTimeMillis();
|
|
||||||
+ long sinceLastKnockback = millis - lastSprintKnockback;
|
|
||||||
+
|
+
|
||||||
+ if (flag1 && sinceLastKnockback >= level().sakuraConfig().players.knockback.sprinting.knockbackDelay.value().orElse(0)) {
|
+ if (flag1 && sinceLastKnockback >= this.level().sakuraConfig().players.knockback.sprinting.knockbackDelay.value().orElse(0)) {
|
||||||
+ extraKnockback += -0.5F + (float) level().sakuraConfig().players.knockback.sprinting.extraKnockback;
|
+ extraKnockback += -0.5F + (float) this.level().sakuraConfig().players.knockback.sprinting.extraKnockback;
|
||||||
+ lastSprintKnockback = millis;
|
+ this.lastSprintKnockback = millis;
|
||||||
+ }
|
+ }
|
||||||
if (target instanceof LivingEntity) {
|
if (target instanceof LivingEntity) {
|
||||||
- ((LivingEntity) target).knockback((double) ((float) i * 0.5F), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
|
- ((LivingEntity) target).knockback((double) ((float) i * 0.5F), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
|
||||||
+ ((LivingEntity) target).knockback((double) (extraKnockback), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
|
+ ((LivingEntity) target).knockback((double) (extraKnockback), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.ENTITY_ATTACK); // CraftBukkit
|
||||||
} else {
|
} else {
|
||||||
- target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
- target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||||
+ target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * extraKnockback), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * extraKnockback), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
+ target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * extraKnockback), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * extraKnockback), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||||
+ // Sakura end - configure extra sprinting knockback
|
+ // Sakura end - configure extra sprinting knockback
|
||||||
}
|
|
||||||
|
|
||||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
|
|
||||||
@@ -1349,7 +1360,7 @@ public abstract class Player extends LivingEntity {
|
|
||||||
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
|
||||||
// CraftBukkit start - Only apply knockback if the damage hits
|
|
||||||
if (entityliving.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API
|
|
||||||
- entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // CraftBukkit
|
|
||||||
+ entityliving.knockback((float) level().sakuraConfig().players.knockback.sweepingEdgeKnockback, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // Sakura - configure entity knockback // CraftBukkit
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
|
||||||
|
@@ -1365,7 +1376,7 @@ public abstract class Player extends LivingEntity {
|
||||||
|
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
||||||
|
// CraftBukkit start - Only apply knockback if the damage hits
|
||||||
|
if (entityliving.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API
|
||||||
|
- entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // CraftBukkit
|
||||||
|
+ entityliving.knockback((float) this.level().sakuraConfig().players.knockback.sweepingEdgeKnockback, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // Sakura - configure entity knockback // CraftBukkit
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
}
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ index 0000000000000000000000000000000000000000..c58e52f7cc012babf4235e405e5fb501
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 62d54547fc8c1a9f7b19a2020b754a189ba7c52f..622ab8f82f1b641f32912788ce44381b88f46093 100644
|
index 69b972a5b1ad62f1cfa759fd2e0d371a8745539b..48f13cd41f68570b3b70e013ced3374bea251601 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1750,6 +1750,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1809,6 +1809,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
worldserver.minimalTNT.clear(); // Sakura - visibility api
|
worldserver.minimalTNT.clear(); // Sakura - visibility api
|
||||||
worldserver.mergeHistory.expire(currentTickLong); // Sakura - merge cannoning entities
|
worldserver.mergeHistory.expire(currentTickLong); // Sakura - merge cannoning entities
|
||||||
worldserver.densityCache.clear(currentTickLong); // Sakura - explosion density cache
|
worldserver.densityCache.clear(currentTickLong); // Sakura - explosion density cache
|
||||||
@@ -124,10 +124,10 @@ index a8008c7550488be34b51f4280f5569170b1ebd1d..2e5a46b9d27b930870c68dbde93d8731
|
|||||||
public String getDescriptionId() {
|
public String getDescriptionId() {
|
||||||
return this.getOrCreateDescriptionId();
|
return this.getOrCreateDescriptionId();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 985386901b4785e83fd8b85db9e05847f9165d1e..7ff26a8df45547b430ff470c32cea81697413bba 100644
|
index 7eb8da4075b4f1706f698a0b48206421bf4353c3..243ac586aad29e3a145eec3c9a85b24901450121 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -261,7 +261,7 @@ public class Explosion {
|
@@ -262,7 +262,7 @@ public class Explosion {
|
||||||
BlockState blockState = chunk.getBlockStateFinal(x, y, z);
|
BlockState blockState = chunk.getBlockStateFinal(x, y, z);
|
||||||
FluidState fluidState = blockState.getFluidState();
|
FluidState fluidState = blockState.getFluidState();
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ index 985386901b4785e83fd8b85db9e05847f9165d1e..7ff26a8df45547b430ff470c32cea816
|
|||||||
|
|
||||||
ret = new ExplosionBlockCache(
|
ret = new ExplosionBlockCache(
|
||||||
key, pos, blockState, fluidState,
|
key, pos, blockState, fluidState,
|
||||||
@@ -275,6 +275,21 @@ public class Explosion {
|
@@ -276,6 +276,21 @@ public class Explosion {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ index 985386901b4785e83fd8b85db9e05847f9165d1e..7ff26a8df45547b430ff470c32cea816
|
|||||||
private boolean clipsAnything(final Vec3 from, final Vec3 to,
|
private boolean clipsAnything(final Vec3 from, final Vec3 to,
|
||||||
final io.papermc.paper.util.CollisionUtil.LazyEntityCollisionContext context,
|
final io.papermc.paper.util.CollisionUtil.LazyEntityCollisionContext context,
|
||||||
final ExplosionBlockCache[] blockCache,
|
final ExplosionBlockCache[] blockCache,
|
||||||
@@ -872,6 +887,16 @@ public class Explosion {
|
@@ -880,6 +895,16 @@ public class Explosion {
|
||||||
// CraftBukkit start - TNTPrimeEvent
|
// CraftBukkit start - TNTPrimeEvent
|
||||||
BlockState iblockdata = this.level.getBlockState(blockposition);
|
BlockState iblockdata = this.level.getBlockState(blockposition);
|
||||||
Block block = iblockdata.getBlock();
|
Block block = iblockdata.getBlock();
|
||||||
@@ -176,10 +176,10 @@ index 985386901b4785e83fd8b85db9e05847f9165d1e..7ff26a8df45547b430ff470c32cea816
|
|||||||
Entity sourceEntity = this.source == null ? null : this.source;
|
Entity sourceEntity = this.source == null ? null : this.source;
|
||||||
BlockPos sourceBlock = sourceEntity == null ? BlockPos.containing(this.x, this.y, this.z) : null;
|
BlockPos sourceBlock = sourceEntity == null ? BlockPos.containing(this.x, this.y, this.z) : null;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 360e72b8e540f3cdb557bc59bca5e0a9cda239f8..d424337f7ee70d6b488dcb8b59a1bd59b87e3e53 100644
|
index 1a150fc2e875860ed25dcda99394c8809d87bb04..cbc20c6a367b373a7b503c21b09db818e14437e5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -231,6 +231,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -228,6 +228,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public final it.unimi.dsi.fastutil.longs.Long2IntMap minimalTNT = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); // Sakura - visibility api
|
public final it.unimi.dsi.fastutil.longs.Long2IntMap minimalTNT = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); // Sakura - visibility api
|
||||||
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
||||||
public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(); // Sakura - explosion density cache
|
public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(); // Sakura - explosion density cache
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Destroy Waterlogged Blocks
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 7ff26a8df45547b430ff470c32cea81697413bba..9f4fbb9475ab011ab6b19e709b6673cd5c9d0895 100644
|
index 243ac586aad29e3a145eec3c9a85b24901450121..c2edd4021fe2bdf96f58f6d402b767f911801cf6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -283,7 +283,11 @@ public class Explosion {
|
@@ -284,7 +284,11 @@ public class Explosion {
|
||||||
|
|
||||||
if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) {
|
if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) {
|
||||||
return Optional.of(material.resistance());
|
return Optional.of(material.resistance());
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ Subject: [PATCH] Cache Vanillia and Eigen Redstone
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
||||||
index fa062e6543e8a0377e3d4715996955dba005ee80..ca8b5066e2db3dc5df97091fa8821493d91949da 100644
|
index 9f17170179cc99d84ad25a1e838aff3d8cc66f93..a1fb1e286d66dde55682d899ded0e5d24715b642 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
--- a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
+++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
|
||||||
@@ -662,6 +662,7 @@ public class RedstoneWireTurbo {
|
@@ -662,6 +662,7 @@ public class RedstoneWireTurbo {
|
||||||
// restores old behavior, at the cost of bypassing the
|
// restores old behavior, at the cost of bypassing the
|
||||||
// max-chained-neighbor-updates server property.
|
// max-chained-neighbor-updates server property.
|
||||||
worldIn.getBlockState(upd.self).neighborChanged(worldIn, upd.self, wire, upd.parent, false);
|
worldIn.getBlockState(upd.self).handleNeighborChanged(worldIn, upd.self, wire, upd.parent, false);
|
||||||
+ worldIn.redstoneTracker.trackUpdate(upd.self, upd.currentState, upd.parent); // Sakura
|
+ worldIn.redstoneTracker.trackUpdate(upd.self, upd.currentState, upd.parent); // Sakura
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -341,10 +341,10 @@ index 0000000000000000000000000000000000000000..c4150b062ee1a15f1938fea2da926699
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 622ab8f82f1b641f32912788ce44381b88f46093..4d16f579d7c73e2374230df519ca3f56c7c14dd5 100644
|
index 48f13cd41f68570b3b70e013ced3374bea251601..303d01e2861b960fd7e592c196944e3cd759f4f4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1751,6 +1751,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1810,6 +1810,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
worldserver.mergeHistory.expire(currentTickLong); // Sakura - merge cannoning entities
|
worldserver.mergeHistory.expire(currentTickLong); // Sakura - merge cannoning entities
|
||||||
worldserver.densityCache.clear(currentTickLong); // Sakura - explosion density cache
|
worldserver.densityCache.clear(currentTickLong); // Sakura - explosion density cache
|
||||||
worldserver.durabilityManager.expire(currentTickLong); // Sakura
|
worldserver.durabilityManager.expire(currentTickLong); // Sakura
|
||||||
@@ -353,10 +353,10 @@ index 622ab8f82f1b641f32912788ce44381b88f46093..4d16f579d7c73e2374230df519ca3f56
|
|||||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index d424337f7ee70d6b488dcb8b59a1bd59b87e3e53..8e5bd44b93cfd4b3abdb76a5ee6dd6eb4e714223 100644
|
index cbc20c6a367b373a7b503c21b09db818e14437e5..9060ce8bcbb82eea6bfa84180a887c04f0137ef5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -232,6 +232,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -229,6 +229,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
public final me.samsuik.sakura.entity.merge.MergeHistory mergeHistory = new me.samsuik.sakura.entity.merge.MergeHistory(); // Sakura - cannon entity merging
|
||||||
public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(); // Sakura - explosion density cache
|
public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(); // Sakura - explosion density cache
|
||||||
public final me.samsuik.sakura.explosion.durable.DurableBlockManager durabilityManager = new me.samsuik.sakura.explosion.durable.DurableBlockManager(); // Sakura - explosion durable blocks
|
public final me.samsuik.sakura.explosion.durable.DurableBlockManager durabilityManager = new me.samsuik.sakura.explosion.durable.DurableBlockManager(); // Sakura - explosion durable blocks
|
||||||
@@ -364,7 +364,7 @@ index d424337f7ee70d6b488dcb8b59a1bd59b87e3e53..8e5bd44b93cfd4b3abdb76a5ee6dd6eb
|
|||||||
|
|
||||||
// Sakura start - add entity retrival methods with search limits
|
// Sakura start - add entity retrival methods with search limits
|
||||||
public void getLimitedEntities(Entity except, AABB box, Predicate<? super Entity> predicate, List<Entity> into, int limit, int search) {
|
public void getLimitedEntities(Entity except, AABB box, Predicate<? super Entity> predicate, List<Entity> into, int limit, int search) {
|
||||||
@@ -1009,6 +1010,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1002,6 +1003,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
} else {
|
} else {
|
||||||
BlockState iblockdata2 = this.getBlockState(pos);
|
BlockState iblockdata2 = this.getBlockState(pos);
|
||||||
|
|
||||||
@@ -373,10 +373,10 @@ index d424337f7ee70d6b488dcb8b59a1bd59b87e3e53..8e5bd44b93cfd4b3abdb76a5ee6dd6eb
|
|||||||
if (iblockdata2 == iblockdata) {
|
if (iblockdata2 == iblockdata) {
|
||||||
if (iblockdata1 != iblockdata2) {
|
if (iblockdata1 != iblockdata2) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
index b5a71fd4e2f55bf036c2c697da5d50cc90fc657c..93df0a39de85a5fa4b0ab680954405171646915d 100644
|
index c131734cad123a35456d18f8a161f77a4ac9ac99..5b9e05b9c717df5a6685f64a6f672575555eb5a4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
@@ -382,7 +382,15 @@ public class RedStoneWireBlock extends Block {
|
@@ -381,7 +381,15 @@ public class RedStoneWireBlock extends Block {
|
||||||
}
|
}
|
||||||
if (oldPower != i) {
|
if (oldPower != i) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -392,7 +392,7 @@ index b5a71fd4e2f55bf036c2c697da5d50cc90fc657c..93df0a39de85a5fa4b0ab68095440517
|
|||||||
world.setBlock(pos, (BlockState) state.setValue(RedStoneWireBlock.POWER, i), 2);
|
world.setBlock(pos, (BlockState) state.setValue(RedStoneWireBlock.POWER, i), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,8 +411,17 @@ public class RedStoneWireBlock extends Block {
|
@@ -402,8 +410,17 @@ public class RedStoneWireBlock extends Block {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
BlockPos blockposition1 = (BlockPos) iterator.next();
|
BlockPos blockposition1 = (BlockPos) iterator.next();
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Falling Block Stacking Restrictions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 7bfbdfd4c61941eb6a95ceeb8face277b31735eb..05c5b6be55bf6a81ff454532b40a372f9b9c8e13 100644
|
index b1193e2d8b43e66cc5a5a03bcc0e77577d98b863..d22c1357006d2785ff2a0e9465a214cf5a262cb1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -250,7 +250,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -252,7 +252,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1);
|
boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1);
|
||||||
boolean flag4 = this.blockState.canSurvive(this.level(), blockposition) && !flag3;
|
boolean flag4 = this.blockState.canSurvive(this.level(), blockposition) && !flag3;
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Added list of ItemEntity's that ignore explosions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
index 29ce703a79f7893ac990ad80e0f1c1cf63546e6c..b658dc82397ed32aacda77d725d15f3d6ccc666c 100644
|
index 8fd3845c4965843be9c37498760d93f1ebdff541..4e3775f47b6124fd0e3ebc2074c5dc35a05e1249 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
@@ -579,6 +579,17 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -590,6 +590,17 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add option to disable entity ai
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index d2c92df28475f0a32a0134324eb0a5609a9afb99..61f93498759e722279a10f750ba2a6e14ab90048 100644
|
index e89f9c3e887601d8461eb967ae0bf582b672f631..cf3889188d1e31d121f86b1f01459f3029e8802f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -898,7 +898,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
@@ -955,7 +955,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||||
protected final void serverAiStep() {
|
protected final void serverAiStep() {
|
||||||
++this.noActionTime;
|
++this.noActionTime;
|
||||||
// Paper start - Allow nerfed mobs to jump and float
|
// Paper start - Allow nerfed mobs to jump and float
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Consistent Explosion Radius
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 9f4fbb9475ab011ab6b19e709b6673cd5c9d0895..085ea33ed1ce47d3eaa5dc72d3baea44991f2c06 100644
|
index c2edd4021fe2bdf96f58f6d402b767f911801cf6..134aff1eccae14a1ebf654222d7016ebf0f07a8f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -584,7 +584,7 @@ public class Explosion {
|
@@ -585,7 +585,7 @@ public class Explosion {
|
||||||
double d2 = CACHED_RAYS[ray + 2];
|
double d2 = CACHED_RAYS[ray + 2];
|
||||||
ray += 3;
|
ray += 3;
|
||||||
// Paper end - optimise explosions
|
// Paper end - optimise explosions
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ Subject: [PATCH] Remove spigot max tnt per tick
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 b4b509bcdd470ff21bbe6e0c3f58848c168bc120..9493fbae91f0ef6c3aaf81e548c225748f6f83b5 100644
|
index bfe1b2debf94c54f923daf81ad51a7e9ca92d3d1..30443bc74abbe0a557b5d9d9bae0eb48ef1dd7d3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -110,7 +110,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -113,7 +113,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
- if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
- if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
||||||
+ // Sakura - remove max tnt per tick
|
+ // Sakura - remove max tnt per tick
|
||||||
if (!this.isNoGravity()) {
|
this.applyGravity();
|
||||||
this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
||||||
}
|
// Paper start - Configurable TNT height nerf
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Option to configure entity water sensitivity
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index e75322367764805443f9a9f5639d804b87a0ab5e..faa95807bb2afbeb90b31f8bee0d30b590a10075 100644
|
index 1766a599850a674a00ba26afe231c0982a6cb653..1b11b7196517018c1fb4d9b77704a86feb3440b5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3528,7 +3528,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -3520,7 +3520,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - Add EntityMoveEvent
|
// Paper end - Add EntityMoveEvent
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configure cannon physics by version
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
index 19086bbfdf3a015eafec5ca868c8d2451f554ef0..510d722fffd4bdcee2db42aefa662c49563ffa81 100644
|
index 299237a0c828e48425cc35a14d366020c78daefb..8014ebfb391825c31d9d1b39f5304a7e76b1ee44 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
@@ -1457,7 +1457,15 @@ public final class CollisionUtil {
|
@@ -1457,7 +1457,15 @@ public final class CollisionUtil {
|
||||||
@@ -68,10 +68,10 @@ index 19086bbfdf3a015eafec5ca868c8d2451f554ef0..510d722fffd4bdcee2db42aefa662c49
|
|||||||
if (xSmaller && z != 0.0) {
|
if (xSmaller && z != 0.0) {
|
||||||
z = performAABBCollisionsZ(axisalignedbb, z, aabbs);
|
z = performAABBCollisionsZ(axisalignedbb, z, aabbs);
|
||||||
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
||||||
index 929231896288c8355c17ba878d3dc296e9b258da..ca7819aa341529d8515e9db7ffe3b9d9186e05f3 100644
|
index 688a2bbd0b0b60b9acbdb3e6da0b24efed2bfde9..da45a8f11f9131e7d3dfe6e96060ec8f8fad6160 100644
|
||||||
--- a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
--- a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
||||||
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
||||||
@@ -169,9 +169,15 @@ public abstract class SpecialisedExplosion<T extends Entity> extends Explosion {
|
@@ -170,9 +170,15 @@ public abstract class SpecialisedExplosion<T extends Entity> extends Explosion {
|
||||||
|
|
||||||
if (distanceFromBottom <= 1.0) {
|
if (distanceFromBottom <= 1.0) {
|
||||||
double x = entity.getX() - pos.x;
|
double x = entity.getX() - pos.x;
|
||||||
@@ -89,10 +89,10 @@ index 929231896288c8355c17ba878d3dc296e9b258da..ca7819aa341529d8515e9db7ffe3b9d9
|
|||||||
if (distance != 0.0D) {
|
if (distance != 0.0D) {
|
||||||
x /= distance;
|
x /= distance;
|
||||||
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
||||||
index b94861d545cefb0e68a83efa6812a1ff4a381027..26e03034f037ff236b8be781a433fdfe69eb0764 100644
|
index 71e1774a6db949ad6c01f1283a17a89ae6af8b02..9f9efcf983aae4018b9792866f975bf7658706be 100644
|
||||||
--- a/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
--- a/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
||||||
+++ b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/TntExplosion.java
|
||||||
@@ -36,6 +36,13 @@ public final class TntExplosion extends SpecialisedExplosion<PrimedTnt> {
|
@@ -37,6 +37,13 @@ public final class TntExplosion extends SpecialisedExplosion<PrimedTnt> {
|
||||||
this.bounds = new AABB(x, y, z, x, y, z);
|
this.bounds = new AABB(x, y, z, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,10 +107,10 @@ index b94861d545cefb0e68a83efa6812a1ff4a381027..26e03034f037ff236b8be781a433fdfe
|
|||||||
protected void startExplosion() {
|
protected void startExplosion() {
|
||||||
for (int i = this.calculateExplosionPotential() - 1; i >= 0; --i) {
|
for (int i = this.calculateExplosionPotential() - 1; i >= 0; --i) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4cacb1429 100644
|
index f3b264f38b8978a18b8849476ca31e96f38272a4..4f4f7b18edeb67e339f268dc97b225dd9f9a82b3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -380,7 +380,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -382,7 +382,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
private final double[] pistonDeltas;
|
private final double[] pistonDeltas;
|
||||||
private long pistonDeltasGameTime;
|
private long pistonDeltasGameTime;
|
||||||
private EntityDimensions dimensions;
|
private EntityDimensions dimensions;
|
||||||
@@ -119,7 +119,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
public boolean isInPowderSnow;
|
public boolean isInPowderSnow;
|
||||||
public boolean wasInPowderSnow;
|
public boolean wasInPowderSnow;
|
||||||
public boolean wasOnFire;
|
public boolean wasOnFire;
|
||||||
@@ -715,6 +715,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -717,6 +717,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
// Sakura end - cannon entity merging
|
// Sakura end - cannon entity merging
|
||||||
public boolean pushedByFluid = true; // Sakura - entity pushed by fluid api
|
public boolean pushedByFluid = true; // Sakura - entity pushed by fluid api
|
||||||
@@ -133,7 +133,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
|
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
@@ -1182,7 +1189,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1224,7 +1231,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkSupportingBlock(boolean onGround, @Nullable Vec3 movement) {
|
protected void checkSupportingBlock(boolean onGround, @Nullable Vec3 movement) {
|
||||||
@@ -142,7 +142,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
AABB axisalignedbb = this.getBoundingBox();
|
AABB axisalignedbb = this.getBoundingBox();
|
||||||
AABB axisalignedbb1 = new AABB(axisalignedbb.minX, axisalignedbb.minY - 1.0E-6D, axisalignedbb.minZ, axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
|
AABB axisalignedbb1 = new AABB(axisalignedbb.minX, axisalignedbb.minY - 1.0E-6D, axisalignedbb.minZ, axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
|
||||||
Optional<BlockPos> optional = this.level.findSupportingBlock(this, axisalignedbb1);
|
Optional<BlockPos> optional = this.level.findSupportingBlock(this, axisalignedbb1);
|
||||||
@@ -1244,7 +1251,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1286,7 +1293,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
if (this.noPhysics) {
|
if (this.noPhysics) {
|
||||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||||
} else {
|
} else {
|
||||||
@@ -151,7 +151,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
movement = this.limitPistonMovement(movement);
|
movement = this.limitPistonMovement(movement);
|
||||||
if (movement.equals(Vec3.ZERO)) {
|
if (movement.equals(Vec3.ZERO)) {
|
||||||
return;
|
return;
|
||||||
@@ -1262,10 +1269,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1304,10 +1311,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
Vec3 vec3d1 = this.collideScan(movement);
|
Vec3 vec3d1 = this.collideScan(movement);
|
||||||
double d0 = vec3d1.lengthSqr();
|
double d0 = vec3d1.lengthSqr();
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
BlockHitResult movingobjectpositionblock = this.level().clip(new ClipContext(this.position(), this.position().add(vec3d1), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this));
|
BlockHitResult movingobjectpositionblock = this.level().clip(new ClipContext(this.position(), this.position().add(vec3d1), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this));
|
||||||
|
|
||||||
if (movingobjectpositionblock.getType() != HitResult.Type.MISS) {
|
if (movingobjectpositionblock.getType() != HitResult.Type.MISS) {
|
||||||
@@ -1301,6 +1308,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1343,6 +1350,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
if (this.horizontalCollision) {
|
if (this.horizontalCollision) {
|
||||||
Vec3 vec3d2 = this.getDeltaMovement();
|
Vec3 vec3d2 = this.getDeltaMovement();
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
this.setDeltaMovement(flag ? 0.0D : vec3d2.x, vec3d2.y, flag1 ? 0.0D : vec3d2.z);
|
this.setDeltaMovement(flag ? 0.0D : vec3d2.x, vec3d2.y, flag1 ? 0.0D : vec3d2.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1342,7 +1355,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1384,7 +1397,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||||
} else {
|
} else {
|
||||||
this.wasOnFire = this.isOnFire();
|
this.wasOnFire = this.isOnFire();
|
||||||
@@ -186,7 +186,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper
|
this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper
|
||||||
this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper
|
this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper
|
||||||
movement = this.limitPistonMovement(movement);
|
movement = this.limitPistonMovement(movement);
|
||||||
@@ -1369,8 +1382,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1411,8 +1424,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
Vec3 vec3d1 = this.collide(movement);
|
Vec3 vec3d1 = this.collide(movement);
|
||||||
double d0 = vec3d1.lengthSqr();
|
double d0 = vec3d1.lengthSqr();
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
BlockHitResult movingobjectpositionblock = this.level().clip(new ClipContext(this.position(), this.position().add(vec3d1), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this));
|
BlockHitResult movingobjectpositionblock = this.level().clip(new ClipContext(this.position(), this.position().add(vec3d1), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this));
|
||||||
|
|
||||||
if (movingobjectpositionblock.getType() != HitResult.Type.MISS) {
|
if (movingobjectpositionblock.getType() != HitResult.Type.MISS) {
|
||||||
@@ -1406,6 +1419,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1448,6 +1461,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
if (this.horizontalCollision) {
|
if (this.horizontalCollision) {
|
||||||
Vec3 vec3d2 = this.getDeltaMovement();
|
Vec3 vec3d2 = this.getDeltaMovement();
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
this.setDeltaMovement(flag ? 0.0D : vec3d2.x, vec3d2.y, flag1 ? 0.0D : vec3d2.z);
|
this.setDeltaMovement(flag ? 0.0D : vec3d2.x, vec3d2.y, flag1 ? 0.0D : vec3d2.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1720,7 +1739,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1762,7 +1781,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
} else {
|
} else {
|
||||||
final AABB bb = currBoundingBox.expandTowards(movement.x, movement.y, movement.z);
|
final AABB bb = currBoundingBox.expandTowards(movement.x, movement.y, movement.z);
|
||||||
collectCollisions(bb, potentialCollisionsVoxel, potentialCollisionsBB);
|
collectCollisions(bb, potentialCollisionsVoxel, potentialCollisionsBB);
|
||||||
@@ -219,7 +219,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1729,7 +1748,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1771,7 +1790,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
double y = movement.y;
|
double y = movement.y;
|
||||||
double z = movement.z;
|
double z = movement.z;
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
|
|
||||||
if (y != 0.0) {
|
if (y != 0.0) {
|
||||||
y = scanY(currBoundingBox, y, voxelList, bbList);
|
y = scanY(currBoundingBox, y, voxelList, bbList);
|
||||||
@@ -1845,7 +1867,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -1887,7 +1909,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return movement;
|
return movement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
|
|
||||||
if (stepHeight > 0.0
|
if (stepHeight > 0.0
|
||||||
&& (onGround || (limitedMoveVector.y != movement.y && movement.y < 0.0))
|
&& (onGround || (limitedMoveVector.y != movement.y && movement.y < 0.0))
|
||||||
@@ -1961,8 +1983,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -2003,8 +2025,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
protected void checkInsideBlocks() {
|
protected void checkInsideBlocks() {
|
||||||
AABB axisalignedbb = this.getBoundingBox();
|
AABB axisalignedbb = this.getBoundingBox();
|
||||||
@@ -255,7 +255,7 @@ index e3b6ef30a3c983e7e9b6bd83bc7baa600b16d850..c7a47485fd056159c448b63217afb8d4
|
|||||||
if (this.level().hasChunksAt(blockposition, blockposition1)) {
|
if (this.level().hasChunksAt(blockposition, blockposition1)) {
|
||||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe7778596a040c97 100644
|
index d22c1357006d2785ff2a0e9465a214cf5a262cb1..b0a6d829a9790744a030cd4b230b71a752e546d0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -90,6 +90,8 @@ public class FallingBlockEntity extends Entity {
|
@@ -90,6 +90,8 @@ public class FallingBlockEntity extends Entity {
|
||||||
@@ -280,7 +280,7 @@ index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe777859
|
|||||||
world.addFreshEntity(entityfallingblock, spawnReason); // CraftBukkit
|
world.addFreshEntity(entityfallingblock, spawnReason); // CraftBukkit
|
||||||
return entityfallingblock;
|
return entityfallingblock;
|
||||||
}
|
}
|
||||||
@@ -190,9 +196,46 @@ public class FallingBlockEntity extends Entity {
|
@@ -190,13 +196,50 @@ public class FallingBlockEntity extends Entity {
|
||||||
// Sakura start
|
// Sakura start
|
||||||
@Override
|
@Override
|
||||||
public final double getEyeY() {
|
public final double getEyeY() {
|
||||||
@@ -327,8 +327,13 @@ index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe777859
|
|||||||
+ // Sakura end - physics version api
|
+ // Sakura end - physics version api
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
protected double getDefaultGravity() {
|
||||||
@@ -201,9 +244,16 @@ public class FallingBlockEntity extends Entity {
|
- return 0.04D;
|
||||||
|
+ return this.physics.before(1_14_0) ? 0.04F : 0.04D; // Sakura - physics version api
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -206,6 +249,11 @@ public class FallingBlockEntity extends Entity {
|
||||||
} else {
|
} else {
|
||||||
Block block = this.blockState.getBlock();
|
Block block = this.blockState.getBlock();
|
||||||
|
|
||||||
@@ -336,17 +341,11 @@ index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe777859
|
|||||||
+ if (this.time == 0 && this.physics.before(1_18_2)) {
|
+ if (this.time == 0 && this.physics.before(1_18_2)) {
|
||||||
+ this.removeBlockOnFall(block);
|
+ this.removeBlockOnFall(block);
|
||||||
+ }
|
+ }
|
||||||
+
|
+ // Sakura end - physics version api
|
||||||
++this.time;
|
++this.time;
|
||||||
if (!this.isNoGravity()) {
|
this.applyGravity();
|
||||||
- this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
|
||||||
+ double gravity = this.physics.before(1_14_0) ? 0.04F : 0.04D;
|
|
||||||
+ this.addDeltaMovement(0.0D, -gravity, 0.0D); // Sakura - reduce movement allocations
|
|
||||||
+ // Sakura end - physics version api
|
|
||||||
}
|
|
||||||
|
|
||||||
this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
||||||
@@ -217,8 +267,16 @@ public class FallingBlockEntity extends Entity {
|
@@ -219,8 +267,15 @@ public class FallingBlockEntity extends Entity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end - Configurable falling blocks height nerf
|
// Paper end - Configurable falling blocks height nerf
|
||||||
@@ -360,11 +359,10 @@ index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe777859
|
|||||||
+ // However, it makes sense for legacy versions pre-1.17 before the world height change.
|
+ // However, it makes sense for legacy versions pre-1.17 before the world height change.
|
||||||
+ BlockPos blockposition = this.physics.before(1_17_0) ? this.patchedBlockPosition() : this.blockPosition();
|
+ BlockPos blockposition = this.physics.before(1_17_0) ? this.patchedBlockPosition() : this.blockPosition();
|
||||||
+ // Sakura end - physics version api
|
+ // Sakura end - physics version api
|
||||||
+
|
|
||||||
boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
|
boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
|
||||||
boolean flag1 = flag && this.level().getFluidState(blockposition).is(FluidTags.WATER);
|
boolean flag1 = flag && this.level().getFluidState(blockposition).is(FluidTags.WATER);
|
||||||
double d0 = this.getDeltaMovement().lengthSqr();
|
double d0 = this.getDeltaMovement().lengthSqr();
|
||||||
@@ -243,8 +301,11 @@ public class FallingBlockEntity extends Entity {
|
@@ -245,8 +300,11 @@ public class FallingBlockEntity extends Entity {
|
||||||
} else {
|
} else {
|
||||||
BlockState iblockdata = this.level().getBlockState(blockposition);
|
BlockState iblockdata = this.level().getBlockState(blockposition);
|
||||||
|
|
||||||
@@ -378,7 +376,7 @@ index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe777859
|
|||||||
if (!this.cancelDrop) {
|
if (!this.cancelDrop) {
|
||||||
boolean flag2 = iblockdata.canBeReplaced((BlockPlaceContext) (new DirectionalPlaceContext(this.level(), blockposition, Direction.DOWN, ItemStack.EMPTY, Direction.UP)));
|
boolean flag2 = iblockdata.canBeReplaced((BlockPlaceContext) (new DirectionalPlaceContext(this.level(), blockposition, Direction.DOWN, ItemStack.EMPTY, Direction.UP)));
|
||||||
boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1);
|
boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1);
|
||||||
@@ -311,7 +372,12 @@ public class FallingBlockEntity extends Entity {
|
@@ -313,7 +371,12 @@ public class FallingBlockEntity extends Entity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,10 +391,10 @@ index 05c5b6be55bf6a81ff454532b40a372f9b9c8e13..b5ecadeb96750cbdca2023eefe777859
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
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 9493fbae91f0ef6c3aaf81e548c225748f6f83b5..8a7864943bf6b3baaa4a5ca5c2052411af3d23da 100644
|
index 30443bc74abbe0a557b5d9d9bae0eb48ef1dd7d3..f775f881b6d89670b3e3900f3023918d6ababe01 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -60,6 +60,13 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -58,6 +58,13 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
case Y -> multiplyDeltaMovement(0, 1, 0);
|
case Y -> multiplyDeltaMovement(0, 1, 0);
|
||||||
}
|
}
|
||||||
// Sakura end
|
// Sakura end
|
||||||
@@ -410,7 +408,7 @@ index 9493fbae91f0ef6c3aaf81e548c225748f6f83b5..8a7864943bf6b3baaa4a5ca5c2052411
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -107,12 +114,30 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -105,10 +112,26 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sakura end
|
// Sakura end
|
||||||
@@ -432,17 +430,13 @@ index 9493fbae91f0ef6c3aaf81e548c225748f6f83b5..8a7864943bf6b3baaa4a5ca5c2052411
|
|||||||
+ // Sakura end - physics version api
|
+ // Sakura end - physics version api
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
protected double getDefaultGravity() {
|
||||||
// Sakura - remove max tnt per tick
|
- return 0.04D;
|
||||||
if (!this.isNoGravity()) {
|
+ return this.physics.before(1_14_0) ? 0.04F : 0.04D; // Sakura - physics version api
|
||||||
- this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations
|
}
|
||||||
+ // Sakura start - physics version api
|
|
||||||
+ double gravity = this.physics.before(1_14_0) ? 0.04F : 0.04D;
|
|
||||||
+ this.addDeltaMovement(0.0D, -gravity, 0.0D); // Sakura - reduce movement allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura - optimise simple entity movement
|
@Override
|
||||||
@@ -122,15 +147,19 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -122,15 +145,19 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end - Configurable TNT height nerf
|
// Paper end - Configurable TNT height nerf
|
||||||
@@ -465,7 +459,7 @@ index 9493fbae91f0ef6c3aaf81e548c225748f6f83b5..8a7864943bf6b3baaa4a5ca5c2052411
|
|||||||
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
|
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
|
||||||
// this.discard();
|
// this.discard();
|
||||||
this.respawnMerged(); // Sakura
|
this.respawnMerged(); // Sakura
|
||||||
@@ -183,7 +212,10 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -183,7 +210,10 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
ExplosionPrimeEvent event = CraftEventFactory.callExplosionPrimeEvent((org.bukkit.entity.Explosive)this.getBukkitEntity());
|
ExplosionPrimeEvent event = CraftEventFactory.callExplosionPrimeEvent((org.bukkit.entity.Explosive)this.getBukkitEntity());
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
@@ -477,7 +471,7 @@ index 9493fbae91f0ef6c3aaf81e548c225748f6f83b5..8a7864943bf6b3baaa4a5ca5c2052411
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
@@ -244,7 +276,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -237,7 +267,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
// Paper start - Option to prevent TNT from moving in water
|
// Paper start - Option to prevent TNT from moving in water
|
||||||
@Override
|
@Override
|
||||||
public boolean isPushedByFluid() {
|
public boolean isPushedByFluid() {
|
||||||
@@ -487,10 +481,10 @@ index 9493fbae91f0ef6c3aaf81e548c225748f6f83b5..8a7864943bf6b3baaa4a5ca5c2052411
|
|||||||
// Paper end - Option to prevent TNT from moving in water
|
// Paper end - Option to prevent TNT from moving in water
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191bb88f057 100644
|
index 134aff1eccae14a1ebf654222d7016ebf0f07a8f..1315eaed58de523ee5e3289494f8d240d2ebe224 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -74,6 +74,7 @@ public class Explosion {
|
@@ -75,6 +75,7 @@ public class Explosion {
|
||||||
public boolean wasCanceled = false;
|
public boolean wasCanceled = false;
|
||||||
public float yield;
|
public float yield;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -498,7 +492,7 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
|
|
||||||
public static DamageSource getDefaultDamageSource(Level world, @Nullable Entity source) {
|
public static DamageSource getDefaultDamageSource(Level world, @Nullable Entity source) {
|
||||||
return world.damageSources().explosion(source, Explosion.getIndirectSourceEntityInternal(source));
|
return world.damageSources().explosion(source, Explosion.getIndirectSourceEntityInternal(source));
|
||||||
@@ -111,6 +112,7 @@ public class Explosion {
|
@@ -112,6 +113,7 @@ public class Explosion {
|
||||||
this.largeExplosionParticles = emitterParticle;
|
this.largeExplosionParticles = emitterParticle;
|
||||||
this.explosionSound = soundEvent;
|
this.explosionSound = soundEvent;
|
||||||
this.yield = this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F; // CraftBukkit
|
this.yield = this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F; // CraftBukkit
|
||||||
@@ -506,7 +500,7 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sakura start - optimise paper explosions
|
// Sakura start - optimise paper explosions
|
||||||
@@ -503,8 +505,12 @@ public class Explosion {
|
@@ -504,8 +506,12 @@ public class Explosion {
|
||||||
final float density = entity.level().densityCache.getKnownDensity(vec3d1);
|
final float density = entity.level().densityCache.getKnownDensity(vec3d1);
|
||||||
if (density != me.samsuik.sakura.explosion.density.BlockDensityCache.UNKNOWN_DENSITY) {
|
if (density != me.samsuik.sakura.explosion.density.BlockDensityCache.UNKNOWN_DENSITY) {
|
||||||
hitResult = density != 0.0f ? net.minecraft.world.phys.HitResult.Type.MISS : net.minecraft.world.phys.HitResult.Type.BLOCK;
|
hitResult = density != 0.0f ? net.minecraft.world.phys.HitResult.Type.MISS : net.minecraft.world.phys.HitResult.Type.BLOCK;
|
||||||
@@ -520,7 +514,7 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
}
|
}
|
||||||
if (hitResult == HitResult.Type.MISS) {
|
if (hitResult == HitResult.Type.MISS) {
|
||||||
// Sakura end - replace density cache
|
// Sakura end - replace density cache
|
||||||
@@ -609,6 +615,14 @@ public class Explosion {
|
@@ -610,6 +616,14 @@ public class Explosion {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cachedBlock.outOfWorld) {
|
if (cachedBlock.outOfWorld) {
|
||||||
@@ -535,7 +529,7 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,9 +728,15 @@ public class Explosion {
|
@@ -715,9 +729,15 @@ public class Explosion {
|
||||||
|
|
||||||
if (d7 <= 1.0D) {
|
if (d7 <= 1.0D) {
|
||||||
double d8 = entity.getX() - this.x;
|
double d8 = entity.getX() - this.x;
|
||||||
@@ -552,7 +546,7 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
|
|
||||||
if (d11 != 0.0D) {
|
if (d11 != 0.0D) {
|
||||||
d8 /= d11;
|
d8 /= d11;
|
||||||
@@ -1048,7 +1068,7 @@ public class Explosion {
|
@@ -1056,7 +1076,7 @@ public class Explosion {
|
||||||
// Sakura start - replace density cache
|
// Sakura start - replace density cache
|
||||||
float blockDensity = this.level.densityCache.getDensity(vec3d, entity);
|
float blockDensity = this.level.densityCache.getDensity(vec3d, entity);
|
||||||
if (blockDensity == me.samsuik.sakura.explosion.density.BlockDensityCache.UNKNOWN_DENSITY) {
|
if (blockDensity == me.samsuik.sakura.explosion.density.BlockDensityCache.UNKNOWN_DENSITY) {
|
||||||
@@ -561,7 +555,7 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
this.level.densityCache.putDensity(vec3d, entity, blockDensity);
|
this.level.densityCache.putDensity(vec3d, entity, blockDensity);
|
||||||
// Sakura end - replace density cache
|
// Sakura end - replace density cache
|
||||||
}
|
}
|
||||||
@@ -1056,6 +1076,17 @@ public class Explosion {
|
@@ -1064,6 +1084,17 @@ public class Explosion {
|
||||||
return blockDensity;
|
return blockDensity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,10 +574,10 @@ index 71c2e458673372a8a332c49ab3cb0cf8560b970e..b52270ce23eb67d7b9acac53a4332191
|
|||||||
private final Level world;
|
private final Level world;
|
||||||
private final double posX, posY, posZ;
|
private final double posX, posY, posZ;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 8e5bd44b93cfd4b3abdb76a5ee6dd6eb4e714223..ea15ef94540b78029c8f78021ace6998f62a701a 100644
|
index 9060ce8bcbb82eea6bfa84180a887c04f0137ef5..3f94145e27b7f4a385da77c72821cd5fa5561aa9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -266,6 +266,205 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -263,6 +263,205 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return this.getLimitedEntities(except, box, net.minecraft.world.entity.EntitySelector.NO_SPECTATORS, limit, search);
|
return this.getLimitedEntities(except, box, net.minecraft.world.entity.EntitySelector.NO_SPECTATORS, limit, search);
|
||||||
}
|
}
|
||||||
// Sakura end - add entity retrival methods with search limits
|
// Sakura end - add entity retrival methods with search limits
|
||||||
@@ -790,7 +784,7 @@ index 8e5bd44b93cfd4b3abdb76a5ee6dd6eb4e714223..ea15ef94540b78029c8f78021ace6998
|
|||||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, Supplier<me.samsuik.sakura.configuration.WorldConfiguration> sakuraWorldConfigCreator, java.util.concurrent.Executor executor) { // Sakura // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, Supplier<me.samsuik.sakura.configuration.WorldConfiguration> sakuraWorldConfigCreator, java.util.concurrent.Executor executor) { // Sakura // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
||||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/FallingBlock.java b/src/main/java/net/minecraft/world/level/block/FallingBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/FallingBlock.java b/src/main/java/net/minecraft/world/level/block/FallingBlock.java
|
||||||
index 7c994b72820cbff158009e86b7d540cb479b01b2..6456e0c20d654b6b001e73bf815da9efd2883a1c 100644
|
index 1ea1232a5ba3e48eef3a139d6487c9a190155ebd..71364fe94cfeefa07fac3ee6359f7abd9bb58106 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/FallingBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/FallingBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/FallingBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/FallingBlock.java
|
||||||
@@ -35,6 +35,15 @@ public abstract class FallingBlock extends Block implements Fallable {
|
@@ -35,6 +35,15 @@ public abstract class FallingBlock extends Block implements Fallable {
|
||||||
@@ -807,10 +801,10 @@ index 7c994b72820cbff158009e86b7d540cb479b01b2..6456e0c20d654b6b001e73bf815da9ef
|
|||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||||
if (isFree(world.getBlockState(pos.below())) && pos.getY() >= world.getMinBuildHeight()) {
|
if (isFree(world.getBlockState(pos.below())) && pos.getY() >= world.getMinBuildHeight()) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java b/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java b/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java
|
||||||
index 6524272aab5a876e2a2164181da72c765959b550..4c242b501e7e5c7af6676b9554b00405838c4eb0 100644
|
index 79df73d352e7c72efb4b0b3ae567b60d19e2150e..7c434d7c55bec4ba1d6013109ed8fd769e8b12f0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/FenceGateBlock.java
|
||||||
@@ -180,8 +180,13 @@ public class FenceGateBlock extends HorizontalDirectionalBlock {
|
@@ -180,8 +180,13 @@ public class FenceGateBlock extends HorizontalDirectionalBlock {
|
||||||
@@ -828,9 +822,9 @@ index 6524272aab5a876e2a2164181da72c765959b550..4c242b501e7e5c7af6676b9554b00405
|
|||||||
+ // Sakura end
|
+ // Sakura end
|
||||||
if ((Boolean) state.getValue(FenceGateBlock.OPEN) != flag1) {
|
if ((Boolean) state.getValue(FenceGateBlock.OPEN) != flag1) {
|
||||||
world.playSound((Player) null, pos, flag1 ? this.type.fenceGateOpen() : this.type.fenceGateClose(), SoundSource.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.1F + 0.9F);
|
world.playSound((Player) null, pos, flag1 ? this.type.fenceGateOpen() : this.type.fenceGateClose(), SoundSource.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.1F + 0.9F);
|
||||||
world.gameEvent((Entity) null, flag1 ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, pos);
|
world.gameEvent((Entity) null, (Holder) (flag1 ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE), pos);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/LadderBlock.java b/src/main/java/net/minecraft/world/level/block/LadderBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/LadderBlock.java b/src/main/java/net/minecraft/world/level/block/LadderBlock.java
|
||||||
index dbfbf477ceef5bd162e1740471f719466f49c1a8..86ed1e1cdbab5004a767831bcb0b34d2b2c3adf8 100644
|
index 4b402a7222f78617ef7d28d329f4daac74954347..54781ea0771327f93a7cf672bb4b2945700c47e5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/LadderBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/LadderBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/LadderBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/LadderBlock.java
|
||||||
@@ -28,6 +28,21 @@ public class LadderBlock extends Block implements SimpleWaterloggedBlock {
|
@@ -28,6 +28,21 @@ public class LadderBlock extends Block implements SimpleWaterloggedBlock {
|
||||||
@@ -866,7 +860,7 @@ index dbfbf477ceef5bd162e1740471f719466f49c1a8..86ed1e1cdbab5004a767831bcb0b34d2
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||||
+ if (world instanceof net.minecraft.world.level.Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
+ if (world instanceof net.minecraft.world.level.Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
||||||
+ return legacyShape(state.getValue(FACING));
|
+ return legacyShape(state.getValue(FACING));
|
||||||
+ }
|
+ }
|
||||||
@@ -875,10 +869,10 @@ index dbfbf477ceef5bd162e1740471f719466f49c1a8..86ed1e1cdbab5004a767831bcb0b34d2
|
|||||||
case NORTH:
|
case NORTH:
|
||||||
return NORTH_AABB;
|
return NORTH_AABB;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
index 9b3dcf1a4d4cece92a629506d341f6bfe79d13d0..1ed3568b363df38b196567d8a93089550913d659 100644
|
index 84623c632d8c2f0fa7ec939c711316d757117d23..baf791608420198493df24c68144fd29ec9fad7f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
@@ -192,8 +192,26 @@ public class LiquidBlock extends Block implements BucketPickup {
|
@@ -190,8 +190,26 @@ public class LiquidBlock extends Block implements BucketPickup {
|
||||||
BlockPos blockposition1 = pos.relative(enumdirection.getOpposite());
|
BlockPos blockposition1 = pos.relative(enumdirection.getOpposite());
|
||||||
|
|
||||||
if (world.getFluidState(blockposition1).is(FluidTags.WATER)) {
|
if (world.getFluidState(blockposition1).is(FluidTags.WATER)) {
|
||||||
@@ -908,11 +902,11 @@ index 9b3dcf1a4d4cece92a629506d341f6bfe79d13d0..1ed3568b363df38b196567d8a9308955
|
|||||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, pos, block.defaultBlockState())) {
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, pos, block.defaultBlockState())) {
|
||||||
this.fizz(world, pos);
|
this.fizz(world, pos);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
index 93df0a39de85a5fa4b0ab680954405171646915d..f2c393dc0b0ece39932f202b404f2e385acd68ef 100644
|
index 5b9e05b9c717df5a6685f64a6f672575555eb5a4..719bac24f454f19460f7abd253fcc82a15648f8a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
@@ -685,6 +685,10 @@ public class RedStoneWireBlock extends Block {
|
@@ -684,6 +684,10 @@ public class RedStoneWireBlock extends Block {
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||||
if (!player.getAbilities().mayBuild) {
|
if (!player.getAbilities().mayBuild) {
|
||||||
return InteractionResult.PASS;
|
return InteractionResult.PASS;
|
||||||
+ // Sakura start
|
+ // Sakura start
|
||||||
@@ -923,7 +917,7 @@ index 93df0a39de85a5fa4b0ab680954405171646915d..f2c393dc0b0ece39932f202b404f2e38
|
|||||||
if (RedStoneWireBlock.isCross(state) || RedStoneWireBlock.isDot(state)) {
|
if (RedStoneWireBlock.isCross(state) || RedStoneWireBlock.isDot(state)) {
|
||||||
BlockState iblockdata1 = RedStoneWireBlock.isCross(state) ? this.defaultBlockState() : this.crossState;
|
BlockState iblockdata1 = RedStoneWireBlock.isCross(state) ? this.defaultBlockState() : this.crossState;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
||||||
index 05e14322e519d1399e87beb532e1cc4a95f689aa..8b86ec469d7d0a0a7a62d563bd585b5b46815517 100644
|
index 932831bb5632ead5850842fc77192c841571162e..fdf07b8aa7a10da15a9473bcb12e8cb0404654f8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
||||||
@@ -21,6 +21,7 @@ public class WaterlilyBlock extends BushBlock {
|
@@ -21,6 +21,7 @@ public class WaterlilyBlock extends BushBlock {
|
||||||
@@ -945,7 +939,7 @@ index 05e14322e519d1399e87beb532e1cc4a95f689aa..8b86ec469d7d0a0a7a62d563bd585b5b
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||||
+ if (world instanceof net.minecraft.world.level.Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
+ if (world instanceof net.minecraft.world.level.Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
||||||
+ return LEGACY_AABB;
|
+ return LEGACY_AABB;
|
||||||
+ }
|
+ }
|
||||||
@@ -954,12 +948,12 @@ index 05e14322e519d1399e87beb532e1cc4a95f689aa..8b86ec469d7d0a0a7a62d563bd585b5b
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java b/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java b/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
||||||
index 54abde54b2341d85c6f02a0a28f02a0e229de42b..4bd60b3f16809bb89212ada6dfc374f0595fec80 100644
|
index f970fca8a8b479f2d2b927bcee2d73f02bfcd1b3..ff31e517a5f2eb51acef070d6455a0f86e40dd9f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
||||||
@@ -111,6 +111,17 @@ public class MovingPistonBlock extends BaseEntityBlock {
|
@@ -110,6 +110,17 @@ public class MovingPistonBlock extends BaseEntityBlock {
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
protected VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||||
PistonMovingBlockEntity pistonMovingBlockEntity = this.getBlockEntity(world, pos);
|
PistonMovingBlockEntity pistonMovingBlockEntity = this.getBlockEntity(world, pos);
|
||||||
+ // Sakura start - physics version api
|
+ // Sakura start - physics version api
|
||||||
+ if (pistonMovingBlockEntity != null && world instanceof Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
+ if (pistonMovingBlockEntity != null && world instanceof Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
||||||
@@ -976,10 +970,10 @@ index 54abde54b2341d85c6f02a0a28f02a0e229de42b..4bd60b3f16809bb89212ada6dfc374f0
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
index be74adc86f0ca467f3b59e7b57fd47a8f381d86e..cd66c83a91ea9ee9f3f48af40889e2d58e0355f5 100644
|
index e0c62227b279a5fe0f3868fbf9ce8c78c515a09c..3f840b82827b803a5fc594f6008cddb09926ca2d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
@@ -170,6 +170,11 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -171,6 +171,11 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
// }
|
// }
|
||||||
// PAIL: checkME - what happened to setTypeAndData?
|
// PAIL: checkME - what happened to setTypeAndData?
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -992,12 +986,12 @@ index be74adc86f0ca467f3b59e7b57fd47a8f381d86e..cd66c83a91ea9ee9f3f48af40889e2d5
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
||||||
index d62cc6e8075b6c1564df29c1b15e8c0246ae786c..b8c33de8aff6c7df5e4e6b628a06d59e8fec4199 100644
|
index bf58f33a5dc11b9e36cb9a26a73558c675a429df..755cbe2925fb5230fdff6c14b94dbafb924ba2c2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
||||||
@@ -138,6 +138,11 @@ public class PistonHeadBlock extends DirectionalBlock {
|
@@ -138,6 +138,11 @@ public class PistonHeadBlock extends DirectionalBlock {
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
protected boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
BlockState blockState = world.getBlockState(pos.relative(state.getValue(FACING).getOpposite()));
|
BlockState blockState = world.getBlockState(pos.relative(state.getValue(FACING).getOpposite()));
|
||||||
+ // Sakura start - physics version api
|
+ // Sakura start - physics version api
|
||||||
+ if (world instanceof Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
+ if (world instanceof Level level && level.localConfig().config(pos).physicsVersion.before(1_9_0)) {
|
||||||
@@ -1008,7 +1002,7 @@ index d62cc6e8075b6c1564df29c1b15e8c0246ae786c..b8c33de8aff6c7df5e4e6b628a06d59e
|
|||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +150,10 @@ public class PistonHeadBlock extends DirectionalBlock {
|
@@ -145,6 +150,10 @@ public class PistonHeadBlock extends DirectionalBlock {
|
||||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||||
if (state.canSurvive(world, pos)) {
|
if (state.canSurvive(world, pos)) {
|
||||||
world.neighborChanged(pos.relative(state.getValue(FACING).getOpposite()), sourceBlock, sourcePos);
|
world.neighborChanged(pos.relative(state.getValue(FACING).getOpposite()), sourceBlock, sourcePos);
|
||||||
+ // Sakura start - physics version api
|
+ // Sakura start - physics version api
|
||||||
@@ -1019,10 +1013,10 @@ index d62cc6e8075b6c1564df29c1b15e8c0246ae786c..b8c33de8aff6c7df5e4e6b628a06d59e
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
index c89e1fe5fafac46d82b2b20d27586c6997ce8906..3ae9eea57de59c2d78a719412cdc6559d657ebb7 100644
|
index d555ad1dd2f648b84920eceec6cc99e8801334b3..b2ecc615379856f661ba87bdeb28f75aa7d61602 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
@@ -163,6 +163,12 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -164,6 +164,12 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
|
|
||||||
double i = 0.0;
|
double i = 0.0;
|
||||||
|
|
||||||
@@ -1035,7 +1029,7 @@ index c89e1fe5fafac46d82b2b20d27586c6997ce8906..3ae9eea57de59c2d78a719412cdc6559
|
|||||||
for (AABB aABB2 : list2) {
|
for (AABB aABB2 : list2) {
|
||||||
AABB aABB3 = PistonMath.getMovementArea(moveByPositionAndProgress(pos, aABB2, blockEntity), direction, d);
|
AABB aABB3 = PistonMath.getMovementArea(moveByPositionAndProgress(pos, aABB2, blockEntity), direction, d);
|
||||||
AABB aABB4 = entity.getBoundingBox();
|
AABB aABB4 = entity.getBoundingBox();
|
||||||
@@ -292,14 +298,167 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -293,14 +299,167 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1203,7 +1197,7 @@ index c89e1fe5fafac46d82b2b20d27586c6997ce8906..3ae9eea57de59c2d78a719412cdc6559
|
|||||||
world.removeBlockEntity(pos);
|
world.removeBlockEntity(pos);
|
||||||
blockEntity.setRemoved();
|
blockEntity.setRemoved();
|
||||||
if (world.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
|
if (world.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
|
||||||
@@ -319,12 +478,23 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -320,12 +479,23 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float f = blockEntity.progress + 0.5F;
|
float f = blockEntity.progress + 0.5F;
|
||||||
@@ -1228,10 +1222,10 @@ index c89e1fe5fafac46d82b2b20d27586c6997ce8906..3ae9eea57de59c2d78a719412cdc6559
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||||
index 67db57686dd29713128d5b233454b6147b8e460b..e53327f05cb6843c6ef78102042369f762e3677f 100644
|
index 5ad6880845ed699077ad355ef1edcfb1c6c7bee4..e6acf6c4bcdb8d2548aa6a8b8d9af7c56877cfd4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||||
@@ -527,7 +527,7 @@ public abstract class FlowingFluid extends Fluid {
|
@@ -525,7 +525,7 @@ public abstract class FlowingFluid extends Fluid {
|
||||||
this.spread(world, pos, state);
|
this.spread(world, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Allow water in the nether
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
index 6371f326fc86cfc53e39bf8ed13b646f7705fbbc..6c2eca802cf04a189e36cd6b37d503cf32ec0aa1 100644
|
index 49557d6f22c5725c663a231deab019d4f6fe95fa..22efc53edf421e6db27a0dcee0961399eaaaeb3e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java
|
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
@@ -195,7 +195,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
@@ -194,7 +194,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
if (!flag2) {
|
if (!flag2) {
|
||||||
return movingobjectpositionblock != null && this.emptyContents(entityhuman, world, movingobjectpositionblock.getBlockPos().relative(movingobjectpositionblock.getDirection()), (BlockHitResult) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit
|
return movingobjectpositionblock != null && this.emptyContents(entityhuman, world, movingobjectpositionblock.getBlockPos().relative(movingobjectpositionblock.getDirection()), (BlockHitResult) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit
|
||||||
@@ -18,7 +18,7 @@ index 6371f326fc86cfc53e39bf8ed13b646f7705fbbc..6c2eca802cf04a189e36cd6b37d503cf
|
|||||||
int j = blockposition.getY();
|
int j = blockposition.getY();
|
||||||
int k = blockposition.getZ();
|
int k = blockposition.getZ();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||||
index 9c8c1df5187daefb1c8098b4d4a0976c71a7bbfd..f5b4733d182f0831ae07a9ff71f2c2e8dd496aaf 100644
|
index 013302623d3ca3ff88f242d740af935dcf4844a6..f043ce5cfbffeeb9789e2f9592397410845c2ba0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||||
@@ -41,7 +41,7 @@ public class IceBlock extends HalfTransparentBlock {
|
@@ -41,7 +41,7 @@ public class IceBlock extends HalfTransparentBlock {
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ Subject: [PATCH] Configure concrete solidifying in water
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index b5ecadeb96750cbdca2023eefe7778596a040c97..fd043df496bded2fb18dae0b8053cd45c5d8c500 100644
|
index b0a6d829a9790744a030cd4b230b71a752e546d0..28ba55a756af15683a48c6badb90f0624bf68911 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -277,7 +277,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -276,7 +276,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
|
// However, it makes sense for legacy versions pre-1.17 before the world height change.
|
||||||
BlockPos blockposition = this.physics.before(1_17_0) ? this.patchedBlockPosition() : this.blockPosition();
|
BlockPos blockposition = this.physics.before(1_17_0) ? this.patchedBlockPosition() : this.blockPosition();
|
||||||
// Sakura end - physics version api
|
// Sakura end - physics version api
|
||||||
|
|
||||||
- boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
|
- boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
|
||||||
+ boolean flag = this.level().sakuraConfig().cannons.sand.concreteSolidifyInWater && this.blockState.getBlock() instanceof ConcretePowderBlock; // Sakura
|
+ boolean flag = this.level().sakuraConfig().cannons.sand.concreteSolidifyInWater && this.blockState.getBlock() instanceof ConcretePowderBlock; // Sakura
|
||||||
boolean flag1 = flag && this.level().getFluidState(blockposition).is(FluidTags.WATER);
|
boolean flag1 = flag && this.level().getFluidState(blockposition).is(FluidTags.WATER);
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Allow explosions to destroy lava
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 9da068ebf5c0245aa099af9e53d34f1dfb5cdde9..3b9e5ffe45dcf1e4a0b2c5d334b0bec666594fa6 100644
|
index 1315eaed58de523ee5e3289494f8d240d2ebe224..d16c58568d3fe343c5c50af0bbb7e1574676caac 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -286,7 +286,7 @@ public class Explosion {
|
@@ -287,7 +287,7 @@ public class Explosion {
|
||||||
if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) {
|
if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) {
|
||||||
return Optional.of(material.resistance());
|
return Optional.of(material.resistance());
|
||||||
// Sakura start - destroy water logged blocks
|
// Sakura start - destroy water logged blocks
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Disable bubble columns affecting cannon entities
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
|
||||||
index addd8b3758254e4f4cd4e951cd065f83ad5dcdf8..2c666b53360b438546f5ffce468a77eed829b039 100644
|
index 4c1f20fafdbd86011959cc2d4983b6c2f8e87a5f..f0c7b64fafbc9d19cc16a70f416df2bee6bb130c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
|
||||||
@@ -48,6 +48,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
|
@@ -48,6 +48,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
|
||||||
@Override
|
@Override
|
||||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
||||||
+ if (!world.sakuraConfig().cannons.tntAndSandAffectedByBubbleColumns && (entity.isPrimedTNT || entity.isFallingBlock)) return; // Sakura - configure bubble columns affecting cannon entities
|
+ if (!world.sakuraConfig().cannons.tntAndSandAffectedByBubbleColumns && (entity.isPrimedTNT || entity.isFallingBlock)) return; // Sakura - configure bubble columns affecting cannon entities
|
||||||
BlockState blockState = world.getBlockState(pos.above());
|
BlockState blockState = world.getBlockState(pos.above());
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Treat all collidable blocks as full while moving fast
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
index 510d722fffd4bdcee2db42aefa662c49563ffa81..37b6d16f0b1e000eb4082a530c7f713482d25a1d 100644
|
index 8014ebfb391825c31d9d1b39f5304a7e76b1ee44..d58d1fb1148db13c5d24422a1553e0b83677ab3d 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
||||||
@@ -1592,6 +1592,7 @@ public final class CollisionUtil {
|
@@ -1592,6 +1592,7 @@ public final class CollisionUtil {
|
||||||
@@ -59,10 +59,10 @@ index 510d722fffd4bdcee2db42aefa662c49563ffa81..37b6d16f0b1e000eb4082a530c7f7134
|
|||||||
AABB singleAABB = blockCollision.getSingleAABBRepresentation();
|
AABB singleAABB = blockCollision.getSingleAABBRepresentation();
|
||||||
if (singleAABB != null) {
|
if (singleAABB != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index c7a47485fd056159c448b63217afb8d4cacb1429..0ebe9db8b648f49819574ae8e495866d33394a57 100644
|
index 4f4f7b18edeb67e339f268dc97b225dd9f9a82b3..0401e0df0ba5566db783bce4df873c63808ae68c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -581,6 +581,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -583,6 +583,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
flags |= io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_LOAD_CHUNKS | io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_ADD_TICKET;
|
flags |= io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_LOAD_CHUNKS | io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_ADD_TICKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add redstone implementation API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d379a07364 100644
|
index 719bac24f454f19460f7abd253fcc82a15648f8a..337d2c020acf0565401d21bce3ba701c0da0ad99 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
@@ -269,7 +269,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -268,7 +268,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
* Note: Added 'source' argument so as to help determine direction of information flow
|
* Note: Added 'source' argument so as to help determine direction of information flow
|
||||||
*/
|
*/
|
||||||
private void updateSurroundingRedstone(Level worldIn, BlockPos pos, BlockState state, BlockPos source) {
|
private void updateSurroundingRedstone(Level worldIn, BlockPos pos, BlockState state, BlockPos source) {
|
||||||
@@ -17,7 +17,7 @@ index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d3
|
|||||||
turbo.updateSurroundingRedstone(worldIn, pos, state, source);
|
turbo.updateSurroundingRedstone(worldIn, pos, state, source);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -293,7 +293,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -292,7 +292,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
int k = worldIn.getBestNeighborSignal(pos1);
|
int k = worldIn.getBestNeighborSignal(pos1);
|
||||||
this.shouldSignal = true;
|
this.shouldSignal = true;
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d3
|
|||||||
// This code is totally redundant to if statements just below the loop.
|
// This code is totally redundant to if statements just below the loop.
|
||||||
if (k > 0 && k > j - 1) {
|
if (k > 0 && k > j - 1) {
|
||||||
j = k;
|
j = k;
|
||||||
@@ -307,7 +307,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -306,7 +306,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
// redstone wire will be set to 'k'. If 'k' is already 15, then nothing inside the
|
// redstone wire will be set to 'k'. If 'k' is already 15, then nothing inside the
|
||||||
// following loop can affect the power level of the wire. Therefore, the loop is
|
// following loop can affect the power level of the wire. Therefore, the loop is
|
||||||
// skipped if k is already 15.
|
// skipped if k is already 15.
|
||||||
@@ -35,7 +35,7 @@ index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d3
|
|||||||
for (Direction enumfacing : Direction.Plane.HORIZONTAL) {
|
for (Direction enumfacing : Direction.Plane.HORIZONTAL) {
|
||||||
BlockPos blockpos = pos1.relative(enumfacing);
|
BlockPos blockpos = pos1.relative(enumfacing);
|
||||||
boolean flag = blockpos.getX() != pos2.getX() || blockpos.getZ() != pos2.getZ();
|
boolean flag = blockpos.getX() != pos2.getX() || blockpos.getZ() != pos2.getZ();
|
||||||
@@ -326,7 +326,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -325,7 +325,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d3
|
|||||||
// The old code would decrement the wire value only by 1 at a time.
|
// The old code would decrement the wire value only by 1 at a time.
|
||||||
if (l > j) {
|
if (l > j) {
|
||||||
j = l - 1;
|
j = l - 1;
|
||||||
@@ -479,7 +479,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -478,7 +478,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||||
if (!oldState.is(state.getBlock()) && !world.isClientSide) {
|
if (!oldState.is(state.getBlock()) && !world.isClientSide) {
|
||||||
// Paper start - optimize redstone - replace call to updatePowerStrength
|
// Paper start - optimize redstone - replace call to updatePowerStrength
|
||||||
- if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
|
- if (world.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
|
||||||
@@ -53,7 +53,7 @@ index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d3
|
|||||||
world.getWireHandler().onWireAdded(pos); // Alternate Current
|
world.getWireHandler().onWireAdded(pos); // Alternate Current
|
||||||
} else {
|
} else {
|
||||||
this.updateSurroundingRedstone(world, pos, state, null); // vanilla/Eigencraft
|
this.updateSurroundingRedstone(world, pos, state, null); // vanilla/Eigencraft
|
||||||
@@ -512,7 +512,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -511,7 +511,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - optimize redstone - replace call to updatePowerStrength
|
// Paper start - optimize redstone - replace call to updatePowerStrength
|
||||||
@@ -62,7 +62,7 @@ index f2c393dc0b0ece39932f202b404f2e385acd68ef..9d8c0d2b5a1d5a23966b49f8fefbb3d3
|
|||||||
world.getWireHandler().onWireRemoved(pos, state); // Alternate Current
|
world.getWireHandler().onWireRemoved(pos, state); // Alternate Current
|
||||||
} else {
|
} else {
|
||||||
this.updateSurroundingRedstone(world, pos, state, null); // vanilla/Eigencraft
|
this.updateSurroundingRedstone(world, pos, state, null); // vanilla/Eigencraft
|
||||||
@@ -553,7 +553,7 @@ public class RedStoneWireBlock extends Block {
|
@@ -552,7 +552,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
// Paper start - optimize redstone (Alternate Current)
|
// Paper start - optimize redstone (Alternate Current)
|
||||||
// Alternate Current handles breaking of redstone wires in the WireHandler.
|
// Alternate Current handles breaking of redstone wires in the WireHandler.
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Reduce entity tracker player updates
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 8a817dda325898b759de63ab6e4300b050286bf7..baec8d775957f3ef3224d743f961f0a23aee92ab 100644
|
index 34fdb52904a26bc7c4c95eee91882a3924ab037c..e372993dffc7012c6dfadacb99b2a7fc43b2aebd 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1145,6 +1145,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1161,6 +1161,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
try {
|
try {
|
||||||
for (TrackedEntity tracker : this.entityMap.values()) {
|
for (TrackedEntity tracker : this.entityMap.values()) {
|
||||||
// update tracker entry
|
// update tracker entry
|
||||||
@@ -16,14 +16,14 @@ index 8a817dda325898b759de63ab6e4300b050286bf7..baec8d775957f3ef3224d743f961f0a2
|
|||||||
tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
|
tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1311,14 +1312,34 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1325,14 +1326,34 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
private final int range;
|
private final int range;
|
||||||
SectionPos lastSectionPos;
|
SectionPos lastSectionPos;
|
||||||
public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
||||||
+ private final int playerSearchInterval; // Sakura - reduce entity tracker player updates
|
+ private final int playerSearchInterval; // Sakura - reduce entity tracker player updates
|
||||||
+ private Vec3 entityPosition; // Sakura - reduce entity tracker player updates
|
+ private Vec3 entityPosition; // Sakura - reduce entity tracker player updates
|
||||||
|
|
||||||
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
|
public TrackedEntity(final Entity entity, final int i, final int j, final boolean flag) {
|
||||||
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
this.range = i;
|
this.range = i;
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add option for legacy lava block formation
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
index 1ed3568b363df38b196567d8a93089550913d659..e5d9b9c1c86b0beab3efdd4784582fd9de0bf926 100644
|
index baf791608420198493df24c68144fd29ec9fad7f..08285f41e2f4904fe6747d91ef8fca697772db15 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
@@ -199,7 +199,15 @@ public class LiquidBlock extends Block implements BucketPickup {
|
@@ -197,7 +197,15 @@ public class LiquidBlock extends Block implements BucketPickup {
|
||||||
if (fluidState.isSource()) {
|
if (fluidState.isSource()) {
|
||||||
block = Blocks.OBSIDIAN;
|
block = Blocks.OBSIDIAN;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Configure mob spawner defaults
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
index 65c3e91ac4541c0150057dc9f012eb1ee566516e..218e06c3e0dd17f2801a5d3ca12b049ee24275a1 100644
|
index f57e1b78204dff661ad5d3ee93a88a00330af2dc..80b00aef33059fa57cb6a63bc0593f8f80c383f3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
@@ -49,7 +49,16 @@ public abstract class BaseSpawner {
|
@@ -51,7 +51,16 @@ public abstract class BaseSpawner {
|
||||||
public int spawnRange = 4;
|
public int spawnRange = 4;
|
||||||
private int tickDelay = 0; // Paper - Configurable mob spawner tick rate
|
private int tickDelay = 0; // Paper - Configurable mob spawner tick rate
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling random dispenser item selection
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
index 881379681c39230a00b3a1f11cd87498984396c7..73e6fbf818944e73885db9c528114b0ea684de47 100644
|
index ab63a233f7db352e325fa4498dd35b125fa8fcea..11cb8b32b3891878f4217d27b7051a4f787f5ebf 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
@@ -73,8 +73,15 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
@@ -74,8 +74,15 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
||||||
int j = 1;
|
int j = 1;
|
||||||
|
|
||||||
for (int k = 0; k < this.items.size(); ++k) {
|
for (int k = 0; k < this.items.size(); ++k) {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add instant mob death animation
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index faa95807bb2afbeb90b31f8bee0d30b590a10075..9fa79ba7f50fa20f3794fd955db1a4cc0fa8ee02 100644
|
index 1b11b7196517018c1fb4d9b77704a86feb3440b5..dea684367869ac4302b0d77540074b5e5cad7db5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -1776,6 +1776,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1802,6 +1802,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
if (this.dead) { // Paper
|
if (this.dead) { // Paper
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Configure fluids breaking redstone
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||||
index e53327f05cb6843c6ef78102042369f762e3677f..c641f445381ed424772e66ca9ea459b30ece9262 100644
|
index e6acf6c4bcdb8d2548aa6a8b8d9af7c56877cfd4..a229c3676ac2e59eb0c9dc114f54b1ae8f9e65ac 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||||
@@ -479,6 +479,10 @@ public abstract class FlowingFluid extends Fluid {
|
@@ -477,6 +477,10 @@ public abstract class FlowingFluid extends Fluid {
|
||||||
LiquidBlockContainer ifluidcontainer = (LiquidBlockContainer) block;
|
|
||||||
|
|
||||||
|
if (block instanceof LiquidBlockContainer ifluidcontainer) {
|
||||||
return ifluidcontainer.canPlaceLiquid((Player) null, world, pos, state, fluid);
|
return ifluidcontainer.canPlaceLiquid((Player) null, world, pos, state, fluid);
|
||||||
+ // Sakura start
|
+ // Sakura start
|
||||||
+ } else if (world instanceof Level level && !level.sakuraConfig().technical.redstone.fluidsBreakRedstone && state.isSignalSource()) {
|
+ } else if (world instanceof Level level && !level.sakuraConfig().technical.redstone.fluidsBreakRedstone && state.isSignalSource()) {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Option to disable explosions hurting players
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
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 94577ca6de11d23d2a2561b645212a7717088974..127b83d92719fb5149d936125423a509779e577d 100644
|
index e039212df79a22a46a87b518ced8b01b067e0153..3954be72bfd1ac3242dc5e3f07b6f78de9677b16 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -935,7 +935,7 @@ public abstract class Player extends LivingEntity {
|
@@ -951,7 +951,7 @@ public abstract class Player extends LivingEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInvulnerableTo(DamageSource damageSource) {
|
public boolean isInvulnerableTo(DamageSource damageSource) {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Iron golems take fall damage
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
||||||
index 6cfe0d6c46caa122db107c607d27a2bdcd82f7a8..fdfb04589869fc06908b61899c225cccb168e117 100644
|
index 932fae98c551052cadba4c6fc6e575fc30a25d58..0f0e9a4c8264fcf3786e7c4707f1a24a368baccb 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
||||||
@@ -240,6 +240,20 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
@@ -235,6 +235,20 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add explosions dropping items config
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index 3b9e5ffe45dcf1e4a0b2c5d334b0bec666594fa6..88a7d47c9c7d142474f54342331a31ade829c9ed 100644
|
index d16c58568d3fe343c5c50af0bbb7e1574676caac..1cef34d0cc8747d136ba7050bfe5a9197426d802 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -941,6 +941,11 @@ public class Explosion {
|
@@ -949,6 +949,11 @@ public class Explosion {
|
||||||
this.level.densityCache.clear(-1);
|
this.level.densityCache.clear(-1);
|
||||||
}
|
}
|
||||||
// Sakura end - explosion density cache
|
// Sakura end - explosion density cache
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Optimise check inside blocks and fluids
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 0ebe9db8b648f49819574ae8e495866d33394a57..bb213891e23b9e6e04d34dda94178db3235b6b7b 100644
|
index 0401e0df0ba5566db783bce4df873c63808ae68c..e5e8b741b72cc4d7f616e0cef848c8e5c60e6b89 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1997,18 +1997,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -2039,18 +2039,37 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
BlockPos blockposition1 = BlockPos.containing(axisalignedbb.maxX - offset, axisalignedbb.maxY - offset, axisalignedbb.maxZ - offset);
|
BlockPos blockposition1 = BlockPos.containing(axisalignedbb.maxX - offset, axisalignedbb.maxY - offset, axisalignedbb.maxZ - offset);
|
||||||
// Sakura end
|
// Sakura end
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ index 0ebe9db8b648f49819574ae8e495866d33394a57..bb213891e23b9e6e04d34dda94178db3
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
iblockdata.entityInside(this.level(), blockposition_mutableblockposition, this);
|
iblockdata.entityInside(this.level(), blockposition_mutableblockposition, this);
|
||||||
@@ -4796,7 +4815,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4853,7 +4872,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||||
@@ -59,7 +59,7 @@ index 0ebe9db8b648f49819574ae8e495866d33394a57..bb213891e23b9e6e04d34dda94178db3
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
AABB axisalignedbb = this.getBoundingBox().deflate(0.001D);
|
AABB axisalignedbb = this.getBoundingBox().deflate(0.001D);
|
||||||
@@ -4813,11 +4832,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4870,11 +4889,30 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
int k1 = 0;
|
int k1 = 0;
|
||||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix paper findSupportingBlock not updating last chunk
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index ea15ef94540b78029c8f78021ace6998f62a701a..0572cf39080e549354b5adf437afc7dc3e8e824c 100644
|
index 3f94145e27b7f4a385da77c72821cd5fa5561aa9..e22488d017263b1105d4361fd9f744ca642b21e7 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -896,6 +896,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -889,6 +889,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
if (chunkDiff != 0) {
|
if (chunkDiff != 0) {
|
||||||
lastChunk = chunkProvider.getChunkAtIfLoadedImmediately(newChunkX, newChunkZ);
|
lastChunk = chunkProvider.getChunkAtIfLoadedImmediately(newChunkX, newChunkZ);
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Avoid searching for lava if throttled water flow speed is
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
index e5d9b9c1c86b0beab3efdd4784582fd9de0bf926..5ae4f1cb1397509df3d1aae7200facade84afe39 100644
|
index 08285f41e2f4904fe6747d91ef8fca697772db15..ff7dfdb79e5a24947135f65b101e7f0afd891c6d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
|
||||||
@@ -147,7 +147,7 @@ public class LiquidBlock extends Block implements BucketPickup {
|
@@ -145,7 +145,7 @@ public class LiquidBlock extends Block implements BucketPickup {
|
||||||
|
|
||||||
// Paper start - Configurable speed for water flowing over lava
|
// Paper start - Configurable speed for water flowing over lava
|
||||||
public int getFlowSpeed(Level world, BlockPos blockposition) {
|
public int getFlowSpeed(Level world, BlockPos blockposition) {
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix doEntityDrops gamerule preventing falling blocks from
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index fd043df496bded2fb18dae0b8053cd45c5d8c500..b773a8b831f1d65f6d442e95b1ab685170567a9c 100644
|
index 28ba55a756af15683a48c6badb90f0624bf68911..adada6c0237e99a226cb24763902dc7bdbccf493 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -352,10 +352,14 @@ public class FallingBlockEntity extends Entity {
|
@@ -351,10 +351,14 @@ public class FallingBlockEntity extends Entity {
|
||||||
tileentity.setChanged();
|
tileentity.setChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add entity travel distance limits
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index ec7d7f22b267ae6572e6005f10221755cbb1a480..2a9a6a9f00343f614a0d2430095a17088861eb1f 100644
|
index 3ca19140d8c7b28f73e80dcdbfd60536d74886ff..91f3850d68fc678ed8764cad35569ed87d423af7 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1417,6 +1417,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1423,6 +1423,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
if (isActive) { // Paper - EAR 2
|
if (isActive) { // Paper - EAR 2
|
||||||
TimingHistory.activatedEntityTicks++;
|
TimingHistory.activatedEntityTicks++;
|
||||||
entity.tick();
|
entity.tick();
|
||||||
@@ -21,10 +21,10 @@ index ec7d7f22b267ae6572e6005f10221755cbb1a480..2a9a6a9f00343f614a0d2430095a1708
|
|||||||
} else { entity.inactiveTick(); } // Paper - EAR 2
|
} else { entity.inactiveTick(); } // Paper - EAR 2
|
||||||
this.getProfiler().pop();
|
this.getProfiler().pop();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index bb213891e23b9e6e04d34dda94178db3235b6b7b..9c7bea04facfb2c2de68c1861e03c0b2a22228ce 100644
|
index e5e8b741b72cc4d7f616e0cef848c8e5c60e6b89..b64d63ad838f825815db01d1968daf725e9f7b86 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -730,6 +730,19 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -732,6 +732,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return this.physics;
|
return this.physics;
|
||||||
}
|
}
|
||||||
// Sakura end - physics version api
|
// Sakura end - physics version api
|
||||||
@@ -44,9 +44,9 @@ index bb213891e23b9e6e04d34dda94178db3235b6b7b..9c7bea04facfb2c2de68c1861e03c0b2
|
|||||||
|
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
@@ -779,6 +792,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -782,6 +795,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.setPos(0.0D, 0.0D, 0.0D);
|
this.setPos(0.0D, 0.0D, 0.0D);
|
||||||
this.eyeHeight = this.getEyeHeight(net.minecraft.world.entity.Pose.STANDING, this.dimensions);
|
this.eyeHeight = this.dimensions.eyeHeight();
|
||||||
this.mergeLevel = level.sakuraConfig().cannons.mergeLevel; // Sakura
|
this.mergeLevel = level.sakuraConfig().cannons.mergeLevel; // Sakura
|
||||||
+ this.travelDistanceLimit = Math.pow(level.sakuraConfig().entity.chunkTravelLimit.getOrDefault(type, Integer.MAX_VALUE) * 16.0, 2); // Sakura - entity travel distance limits
|
+ this.travelDistanceLimit = Math.pow(level.sakuraConfig().entity.chunkTravelLimit.getOrDefault(type, Integer.MAX_VALUE) * 16.0, 2); // Sakura - entity travel distance limits
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Configure potion speed and breaking inside entities
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
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 156809090f1f83ad68e7e2477a3cfddac5757a8e..f834a3a2634a7b245ea8881b2cc613296f3b94ba 100644
|
index 74c596264d4da551437bd2a23e1c70022cfc73fc..fc0102cbf4b759001f5b76e4c60b403be9b20185 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
@@ -151,7 +151,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
@@ -150,7 +150,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
super.tick();
|
super.tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ index 156809090f1f83ad68e7e2477a3cfddac5757a8e..f834a3a2634a7b245ea8881b2cc61329
|
|||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java b/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java b/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java
|
||||||
index 8bf45af0b802b90b7e27197ca16e9f2ebe0162e9..3ab65cb7d891ddba011afd795dbf699f37cb8a17 100644
|
index 877365a953a0debd14ca8d33073754452ea2f026..5b2728eb9243b0136d77164539f397de406215ca 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/ProjectileUtil.java
|
||||||
@@ -51,7 +51,14 @@ public final class ProjectileUtil {
|
@@ -51,7 +51,14 @@ public final class ProjectileUtil {
|
||||||
@@ -38,10 +38,10 @@ index 8bf45af0b802b90b7e27197ca16e9f2ebe0162e9..3ab65cb7d891ddba011afd795dbf699f
|
|||||||
hitResult = hitResult2;
|
hitResult = hitResult2;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||||
index 19af5552e36964996082226b4f77561d7deb99f6..23c19fb83603974d3d70bc983cf7763bf05142bf 100644
|
index c64e0d623124ad9116cb6c5c7c3320fad7cc1aa3..95c780bbe78370b3426af41c83905ab98b5d3d6b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||||
@@ -61,6 +61,25 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
@@ -62,6 +62,25 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||||
super(EntityType.POTION, x, y, z, world);
|
super(EntityType.POTION, x, y, z, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ Subject: [PATCH] Disable player poses shrinking collision box
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
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 127b83d92719fb5149d936125423a509779e577d..b0dd1e699e743ed9fa7bd7499d81d813be89d3f2 100644
|
index 3954be72bfd1ac3242dc5e3f07b6f78de9677b16..24ff6c126565e07753137e4fa908314144b4a7d8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -2243,7 +2243,13 @@ public abstract class Player extends LivingEntity {
|
@@ -2283,7 +2283,13 @@ public abstract class Player extends LivingEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityDimensions getDimensions(Pose pose) {
|
public EntityDimensions getDefaultDimensions(Pose pose) {
|
||||||
- return (EntityDimensions) Player.POSES.getOrDefault(pose, Player.STANDING_DIMENSIONS);
|
- return (EntityDimensions) Player.POSES.getOrDefault(pose, Player.STANDING_DIMENSIONS);
|
||||||
+ // Sakura start - player poses shrink collision box
|
+ // Sakura start - player poses shrink collision box
|
||||||
+ EntityDimensions dimensions = (EntityDimensions) Player.POSES.getOrDefault(pose, Player.STANDING_DIMENSIONS);
|
+ EntityDimensions dimensions = (EntityDimensions) Player.POSES.getOrDefault(pose, Player.STANDING_DIMENSIONS);
|
||||||
+ if (!level().sakuraConfig().players.posesShrinkCollisionBox && dimensions.height == 0.6f) {
|
+ if (!level().sakuraConfig().players.posesShrinkCollisionBox && dimensions.height() == 0.6f) {
|
||||||
+ dimensions = Player.STANDING_DIMENSIONS;
|
+ dimensions = Player.STANDING_DIMENSIONS;
|
||||||
+ }
|
+ }
|
||||||
+ return dimensions;
|
+ return dimensions;
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Mob spawner behaviour
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
index 218e06c3e0dd17f2801a5d3ca12b049ee24275a1..de0ca67b4bc51bd2001f4b5b9e483ad650318c08 100644
|
index 80b00aef33059fa57cb6a63bc0593f8f80c383f3..937c8b7db6b72cb89859a81386b1df80d4f3e6ef 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||||
@@ -66,7 +66,7 @@ public abstract class BaseSpawner {
|
@@ -68,7 +68,7 @@ public abstract class BaseSpawner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNearPlayer(Level world, BlockPos pos) {
|
public boolean isNearPlayer(Level world, BlockPos pos) {
|
||||||
@@ -17,8 +17,8 @@ index 218e06c3e0dd17f2801a5d3ca12b049ee24275a1..de0ca67b4bc51bd2001f4b5b9e483ad6
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clientTick(Level world, BlockPos pos) {
|
public void clientTick(Level world, BlockPos pos) {
|
||||||
@@ -137,7 +137,7 @@ public abstract class BaseSpawner {
|
@@ -139,7 +139,7 @@ public abstract class BaseSpawner {
|
||||||
if (!mobspawnerdata_a.blockLightLimit().isValueInRange(world.getBrightness(LightLayer.BLOCK, blockposition1)) || !mobspawnerdata_a.skyLightLimit().isValueInRange(world.getBrightness(LightLayer.SKY, blockposition1))) {
|
if (!mobspawnerdata_a.isValidPosition(blockposition1, world)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
- } else if (!SpawnPlacements.checkSpawnRules((EntityType) optional.get(), world, MobSpawnType.SPAWNER, blockposition1, world.getRandom())) {
|
- } else if (!SpawnPlacements.checkSpawnRules((EntityType) optional.get(), world, MobSpawnType.SPAWNER, blockposition1, world.getRandom())) {
|
||||||
@@ -26,7 +26,7 @@ index 218e06c3e0dd17f2801a5d3ca12b049ee24275a1..de0ca67b4bc51bd2001f4b5b9e483ad6
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Paper start - PreCreatureSpawnEvent
|
// Paper start - PreCreatureSpawnEvent
|
||||||
@@ -165,7 +165,7 @@ public abstract class BaseSpawner {
|
@@ -167,7 +167,7 @@ public abstract class BaseSpawner {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ index 218e06c3e0dd17f2801a5d3ca12b049ee24275a1..de0ca67b4bc51bd2001f4b5b9e483ad6
|
|||||||
|
|
||||||
if (k >= this.maxNearbyEntities) {
|
if (k >= this.maxNearbyEntities) {
|
||||||
this.delay(world, pos);
|
this.delay(world, pos);
|
||||||
@@ -177,7 +177,7 @@ public abstract class BaseSpawner {
|
@@ -179,7 +179,7 @@ public abstract class BaseSpawner {
|
||||||
if (entity instanceof Mob) {
|
if (entity instanceof Mob) {
|
||||||
Mob entityinsentient = (Mob) entity;
|
Mob entityinsentient = (Mob) entity;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user