From 244640ad7c508a8b94910e47cff138301f76312a Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 21 Aug 2023 16:29:56 -0300 Subject: [PATCH] Folia --- build.gradle.kts | 9 ++- gradle.properties | 2 +- patches/server/0001-Build-changes.patch | 63 +++++++++---------- .../0003-ResourceLocation-validation.patch | 14 ++--- ...-if-items-are-air-before-calling-set.patch | 4 +- ...ate-BlockState-and-SoundEvent-values.patch | 4 +- .../0012-Change-version-fetcher-to-AMG.patch | 12 ++-- ...-handling-of-invalid-JSON-components.patch | 8 +-- ...-Scissors-configuration-file-command.patch | 10 +-- .../0021-Fix-negative-death-times.patch | 14 ++--- patches/server/0024-Reset-large-tags.patch | 10 +-- ...5-Don-t-log-invalid-teams-to-console.patch | 4 +- .../0028-Add-spectator-teleport-event.patch | 6 +- ...029-Prevent-invalid-container-events.patch | 4 +- ...ck-entity-entity-tag-query-positions.patch | 6 +- .../server/0034-Prevent-velocity-freeze.patch | 8 +-- ...on-option-to-disable-chat-signatures.patch | 10 +-- ...tch-invalid-entity-rotation-log-spam.patch | 4 +- .../server/0039-Limit-map-decorations.patch | 4 +- ...player-banning-using-duplicate-UUIDs.patch | 4 +- ...Don-t-warn-on-duplicate-entity-UUIDs.patch | 4 +- .../0044-Implement-command-block-events.patch | 6 +- ...on-t-log-on-too-many-chained-updates.patch | 4 +- ...0049-Fix-packet-related-lag-exploits.patch | 10 +-- 24 files changed, 111 insertions(+), 113 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index db662da..f5b72a1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -58,8 +58,13 @@ paperweight { remapRepo.set(paperMavenPublicUrl) decompileRepo.set(paperMavenPublicUrl) - usePaperUpstream(providers.gradleProperty("paperRef")) { - withPaperPatcher { + useStandardUpstream("Folia") { + url.set(github("PaperMC", "Folia")) + ref.set(providers.gradleProperty("foliaRef")) + + withStandardPatcher { + baseName("Folia") + apiPatchDir.set(layout.projectDirectory.dir("patches/api")) apiOutputDir.set(layout.projectDirectory.dir("Scissors-API")) diff --git a/gradle.properties b/gradle.properties index fc0a31d..8564096 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=me.totalfreedom.scissors version=1.20.1-R0.1-SNAPSHOT mcVersion=1.20.1 -paperRef=73af2d4cea597e65dd13dafab6325ea5709c9067 +foliaRef=f6e91e9a4cd5ba4eb5a1f89f71fd6b4f2bd0fbef org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 14b15fc..3441cf3 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -5,25 +5,27 @@ Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index fb98936bb8a5488db75d676c5bcb4060597fbbf8..904bf48288e0865db9bbe8d2ca183b8385f73407 100644 +index 9ee90bc753e65f9dd532f28ec75cc16bf16486c8..9ca282a17c94d1314c625ca4ad15bb899cd6e02f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { +@@ -13,12 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { val alsoShade: Configuration by configurations.creating dependencies { -- implementation(project(":paper-api")) -- implementation(project(":paper-mojangapi")) +- // Folia start +- implementation(project(":folia-api")) +- implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") { + // Scissors start + implementation(project(":Scissors-API")) + implementation("io.papermc.paper:paper-mojangapi:1.20.1-R0.1-SNAPSHOT") { -+ exclude("io.papermc.paper", "paper-api") -+ } + exclude("io.papermc.paper", "paper-api") + } +- // Folia end + // Scissors end // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -68,11 +72,19 @@ tasks.jar { +@@ -72,11 +72,19 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper @@ -40,30 +42,21 @@ index fb98936bb8a5488db75d676c5bcb4060597fbbf8..904bf48288e0865db9bbe8d2ca183b83 attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", -- "Implementation-Version" to "git-Paper-$implementationVersion", -+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors +- "Implementation-Version" to "git-Folia-$implementationVersion", // Folia ++ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors // Folia "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -149,7 +161,7 @@ fun TaskContainer.registerRunTask( - name: String, - block: JavaExec.() -> Unit - ): TaskProvider = register(name) { -- group = "paper" -+ group = "paperweight" // Scissors - mainClass.set("org.bukkit.craftbukkit.Main") - standardInput = System.`in` - workingDir = rootProject.layout.projectDirectory diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d07175ca09 100644 +index cb60d58d4a7556dd896f31d0cd249f860bb3ef84..f7038ee0d3475ee9c187da8feb12ff4553130e1d 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { -- Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger()); -+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors +- Metrics metrics = new Metrics("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page ++ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors // Folia - we have our own bstats page metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); @@ -71,13 +64,13 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d0 final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion(); if (implVersion != null) { final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1); -- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); -+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors +- paperVersion = "git-Folia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page ++ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors // Folia - we have our own bstats page } else { paperVersion = "unknown"; } -- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion)); -+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors +- metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page ++ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors // Folia - we have our own bstats page metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); @@ -95,41 +88,41 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166 .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3238cbcba567b1242c77e41f6b6f19a8d157fb4e..dd4dc6b29e37a4db459779fa8d4adc231e44d144 100644 +index 355acd1dd3b2e9f2a086a8d95928cdebbf63d06f..840105551533aef45583f0c36ee7fc41bcd0d2d0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1693,7 +1693,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return "Scissors"; // Scissors - Scissors > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! +- return "Folia"; // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Scissors"; // Scissors - Scissors > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! } 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 -index 54f27d91f941235a99e341ed84531ad7f0840728..3758aab606498e7b5fe322bb49ac0731815269e7 100644 +index 9485d754ec6ce4031d88734e327abda240d9db90..442cbb83e520df2ba890b291a618b5bb4ad8dc9d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { -- private final String serverName = "Paper"; // Paper -+ private final String serverName = "Scissors"; // Scissors // Paper +- private final String serverName = "Folia"; // Folia // Paper ++ private final String serverName = "Scissors"; // Scissors // Folia // Paper private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 774556a62eb240da42e84db4502e2ed43495be17..741c76c4dfa0bb34cc23bd795c194bdea10418cc 100644 +index e9b6ca3aa25e140467ae866d572483050ea3fa0e..bb37db7715b7c5eb497f4d5f5a32668ad947943b 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -11,7 +11,7 @@ public final class Versioning { public static String getBukkitVersion() { String result = "Unknown-Version"; -- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties"); -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/Scissors-API/pom.properties"); // Scissors +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/dev.folia/folia-api/pom.properties"); // Folia ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/Scissors-API/pom.properties"); // Folia // Scissors Properties properties = new Properties(); if (stream != null) { diff --git a/patches/server/0003-ResourceLocation-validation.patch b/patches/server/0003-ResourceLocation-validation.patch index 9eb766b..60c717f 100644 --- a/patches/server/0003-ResourceLocation-validation.patch +++ b/patches/server/0003-ResourceLocation-validation.patch @@ -31,7 +31,7 @@ index 2ee4ee14ab3345486dad6b24fd9a4fcc6c746b99..c5ac6cda91a81d3075f5c763e30dc009 @Override diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java -index 8e4cb2fa787feca47dd4ba2fbb44e6193bac2431..000aa76e3f4dce8129dbd1868cfc244515997c0c 100644 +index a178f00744ad2e27c0f35d69803574e5a16ec294..a971a7efc8e2a318d596f668e35a933de90b0525 100644 --- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java +++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java @@ -408,7 +408,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity { @@ -66,10 +66,10 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b5192 @Nullable diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..0bb87ca2556ca41e0b14503d3ae62e0fc133a209 100644 +index a21edc7df32a59a6cb1af3865d2ce35f72cf8afc..0b272b0cf56dcb1c509fa63ff0f6e526c5536748 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -618,7 +618,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -638,7 +638,7 @@ public abstract class Mob extends LivingEntity implements Targeting { this.setLeftHanded(nbt.getBoolean("LeftHanded")); if (nbt.contains("DeathLootTable", 8)) { @@ -157,10 +157,10 @@ index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf11cf046fb 100644 +index b7d0892953f357e58665e87fbcf794a75f1c0980..e65232cb1abd59b896650e249a2b2ad8b0828712 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -@@ -33,8 +33,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo +@@ -41,8 +41,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo return null; // return empty loot table? } @@ -178,10 +178,10 @@ index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf1 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 18b9b0dc70f6872a9d71c120bcd2edca531b0ac4..4732fff6d1198e5fc4875b4d4523aa2d152817ea 100644 +index 148d0393b093a326f76fc34c035768f4758f3f1b..43034806bf8dcd940e1ec47edd3875adb9cefe0f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -80,8 +80,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { +@@ -88,8 +88,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { @Override public LootTable getLootTable() { diff --git a/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch b/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch index 15dc434..2df6fad 100644 --- a/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch +++ b/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemEntity - Check if items are air before calling setItem 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 52196431a6538872755344859a0454a0e50c3b6e..2312881cdd925ec538fff3df7cdc7e04770453eb 100644 +index 76e010769786132d8af3889051b3f52e9f683509..c8ac6e7dd19dfe38a99364f586c8d8d5e2539fb4 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -425,11 +425,15 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -424,11 +424,15 @@ public class ItemEntity extends Entity implements TraceableEntity { CompoundTag nbttagcompound1 = nbt.getCompound("Item"); diff --git a/patches/server/0010-Validate-BlockState-and-SoundEvent-values.patch b/patches/server/0010-Validate-BlockState-and-SoundEvent-values.patch index 043cad0..38550f9 100644 --- a/patches/server/0010-Validate-BlockState-and-SoundEvent-values.patch +++ b/patches/server/0010-Validate-BlockState-and-SoundEvent-values.patch @@ -18,10 +18,10 @@ index a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa..a78595e91cbb6a815c9ef6b4596cdb0e if (optional.isEmpty()) { return Blocks.AIR.defaultBlockState(); diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 7226be19248a1ffb8ff2c89b55882529d33a6c0c..e77605a506edd5fd7380eaa13de0213cbd370f65 100644 +index ea3d0a50ff4effdf61ec3c6c99c378cbd816c83c..b3ea5eecf351c89ef4e4019c07f46d88ff8ec395 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -541,7 +541,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -546,7 +546,7 @@ public abstract class AbstractArrow extends Projectile { this.setCritArrow(nbt.getBoolean("crit")); this.setPierceLevel(nbt.getByte("PierceLevel")); if (nbt.contains("SoundEvent", 8)) { diff --git a/patches/server/0012-Change-version-fetcher-to-AMG.patch b/patches/server/0012-Change-version-fetcher-to-AMG.patch index a98dfba..51b12c3 100644 --- a/patches/server/0012-Change-version-fetcher-to-AMG.patch +++ b/patches/server/0012-Change-version-fetcher-to-AMG.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Change version fetcher to AMG diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120869f57a1 100644 +index e2f704c115fd6e00960bb56bb0779f1100c89c17..0a821ba42f850b95412c89eba8f66dbf0d6b5c66 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -4,11 +4,13 @@ import com.destroystokyo.paper.util.VersionFetcher; @@ -37,10 +37,10 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120 @Nonnull @Override public Component getVersionMessage(@Nonnull String serverVersion) { -- String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]"); -- final Component updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]); -+ String[] parts = serverVersion.substring("git-Scissors-".length()).split("[-\\s]"); // Scissors -+ final Component updateMessage = getUpdateStatusMessage("AtlasMediaGroup/Scissors", GITHUB_BRANCH_NAME, parts[0]); // Scissors +- String[] parts = serverVersion.substring("git-Folia-".length()).split("[-\\s]"); // Folia +- final Component updateMessage = getUpdateStatusMessage("PaperMC/Folia", GITHUB_BRANCH_NAME, parts[0]); // Folia ++ String[] parts = serverVersion.substring("git-Scissors-".length()).split("[-\\s]"); // Scissors // Folia ++ final Component updateMessage = getUpdateStatusMessage("AtlasMediaGroup/Scissors", GITHUB_BRANCH_NAME, parts[0]); // Scissors // Folia final Component history = getHistory(); return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; @@ -77,7 +77,7 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120 switch (distance) { case -1: diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index d4f6935a1bea77e5118bfd538f9b1358c21591a7..2a834708001ea940d8ab6f6559024df32b1e9520 100644 +index 776b7fc26fe96b69be260bbd36efae147d988640..344bef62aa1551a6a09c10492cbc26acb63fa105 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -292,7 +292,7 @@ public class Main { diff --git a/patches/server/0013-Better-handling-of-invalid-JSON-components.patch b/patches/server/0013-Better-handling-of-invalid-JSON-components.patch index be80619..9cc76d7 100644 --- a/patches/server/0013-Better-handling-of-invalid-JSON-components.patch +++ b/patches/server/0013-Better-handling-of-invalid-JSON-components.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Better handling of invalid JSON components diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java -index c69088a2ec374b2d236fec61e267f42afa2967b1..7ca1ece926b0ef4598d4fa913b96d1e7a0e5bba4 100644 +index ff6716210d13db4472c67a56003b24c7b0af8224..5776efcd947d7522a3c3d6c7bba48a075a6f6c44 100644 --- a/src/main/java/io/papermc/paper/util/MCUtil.java +++ b/src/main/java/io/papermc/paper/util/MCUtil.java -@@ -559,13 +559,7 @@ public final class MCUtil { +@@ -573,13 +573,7 @@ public final class MCUtil { return null; } String string = compound.getString(key); @@ -128,10 +128,10 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..9d20f3f1af8e663a8c13714c8928d4a9 } }).reduce((accumulator, current) -> { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2edab21bb271405f200de5a19e9c748bb14aba7d..afd25ef82b88521925d2b92286ab8fbda9983a0a 100644 +index 8b28f6fed78cbad95b7943efb05099edd9eeed57..4a07d55d2788508bb5849d01aac08ad281bb2060 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2485,12 +2485,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2489,12 +2489,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.setRot(this.getYRot(), this.getXRot()); if (nbt.contains("CustomName", 8)) { String s = nbt.getString("CustomName"); diff --git a/patches/server/0016-Add-Scissors-configuration-file-command.patch b/patches/server/0016-Add-Scissors-configuration-file-command.patch index c5ec8db..7ab6e67 100644 --- a/patches/server/0016-Add-Scissors-configuration-file-command.patch +++ b/patches/server/0016-Add-Scissors-configuration-file-command.patch @@ -426,7 +426,7 @@ index dae36c6452ccd57a436dd918547b64d59957ab0a..d450cf3cf8ab5cbb5d32a28ee2e4a671 if (optionset.has("initSettings")) { // CraftBukkit diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 9f422cbeaa52b3e6a0a27af4f8ad4ddb7808483f..bbfb536ddec7f44d2a75d35ab495be26104678a1 100644 +index 78ada86028bac06b62a7d70776a29705a3b11a06..085eebadc3aa8ef717d96333277a941d4bd152e9 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -447,10 +447,10 @@ index 9f422cbeaa52b3e6a0a27af4f8ad4ddb7808483f..bbfb536ddec7f44d2a75d35ab495be26 this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setMotd(dedicatedserverproperties.motd); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3758aab606498e7b5fe322bb49ac0731815269e7..8af5a986337c79580060217e1f5ef343719b1493 100644 +index 442cbb83e520df2ba890b291a618b5bb4ad8dc9d..2ca411f29e68c94b9086776ac3200e2807c12c0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1056,6 +1056,7 @@ public final class CraftServer implements Server { +@@ -1097,6 +1097,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot @@ -458,7 +458,7 @@ index 3758aab606498e7b5fe322bb49ac0731815269e7..8af5a986337c79580060217e1f5ef343 this.console.paperConfigurations.reloadConfigs(this.console); for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty -@@ -1087,6 +1088,7 @@ public final class CraftServer implements Server { +@@ -1128,6 +1129,7 @@ public final class CraftServer implements Server { this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper @@ -466,7 +466,7 @@ index 3758aab606498e7b5fe322bb49ac0731815269e7..8af5a986337c79580060217e1f5ef343 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2902,6 +2904,14 @@ public final class CraftServer implements Server { +@@ -2945,6 +2947,14 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } diff --git a/patches/server/0021-Fix-negative-death-times.patch b/patches/server/0021-Fix-negative-death-times.patch index 61c8bd3..35b1ab8 100644 --- a/patches/server/0021-Fix-negative-death-times.patch +++ b/patches/server/0021-Fix-negative-death-times.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Fix negative death times diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index e11d7283662834047b2ff81a2fd25a4263792deb..4bd7eea49a0720063db2a8ed10f53bd19e9499ad 100644 +index f636bdf1075fa784ce7ee25478d4d94bacb05677..77275e948b3636d21cca8f59c35834e8fdb339c7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -629,7 +629,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - +@@ -637,7 +637,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + public boolean broadcastedDeath = false; // Folia - region threading protected void tickDeath() { ++this.deathTime; -- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved()) { -+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved()) { // Scissors +- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved() && !this.broadcastedDeath) { // Folia - region threading ++ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved() && !this.broadcastedDeath) { // Scissors // Folia - region threading this.level().broadcastEntityEvent(this, (byte) 60); - this.remove(Entity.RemovalReason.KILLED); - } + this.broadcastedDeath = true; // Folia - region threading - death has been broadcasted + if (!(this instanceof ServerPlayer)) this.remove(Entity.RemovalReason.KILLED); // Folia - region threading - don't remove, we want the tick scheduler to be running diff --git a/patches/server/0024-Reset-large-tags.patch b/patches/server/0024-Reset-large-tags.patch index dffe911..5ab4ebf 100644 --- a/patches/server/0024-Reset-large-tags.patch +++ b/patches/server/0024-Reset-large-tags.patch @@ -59,7 +59,7 @@ index 4092c7a8c2b0d9d26e6f4d97386735236300d132..04c47cf1a920ae6c356449df801227ee } } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 879cc823d56625867eb73bb621db6a13f40ad81c..e61958a69bbccd08093932cd7fe74139b1054514 100644 +index d30156d5cb888b8cf2af9aee9b94e242a6510192..7fb7337256a0c3cdde587fb5a9222bb8faa322ec 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -21,6 +21,7 @@ import java.util.function.Predicate; @@ -83,7 +83,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..e61958a69bbccd08093932cd7fe74139 this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id"))); this.count = nbttagcompound.getByte("Count"); if (nbttagcompound.contains("tag", 10)) { -@@ -555,7 +562,11 @@ public final class ItemStack { +@@ -556,7 +563,11 @@ public final class ItemStack { nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString()); nbt.putByte("Count", (byte) this.count); if (this.tag != null) { @@ -96,7 +96,7 @@ index 879cc823d56625867eb73bb621db6a13f40ad81c..e61958a69bbccd08093932cd7fe74139 } return nbt; -@@ -885,6 +896,7 @@ public final class ItemStack { +@@ -886,6 +897,7 @@ public final class ItemStack { // Paper end public void setTag(@Nullable CompoundTag nbt) { @@ -164,7 +164,7 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..a9a8c9e68e5b767dec2c26495685da88 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -index c57efcb9a79337ec791e4e8f6671612f0a82b441..2cbb8170953cb555411db8c171a3d1d91eb799bb 100644 +index 526d1bfd5ad0de7bcfd0c2da902515f3dec94c54..2cf0e645aeae983ec6db9b1a25401120fd968f06 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java @@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity; @@ -252,7 +252,7 @@ index 881379681c39230a00b3a1f11cd87498984396c7..d0513b72cdaec3b67b9341d251367b19 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index b11f51762ca289d99eaa49e66e31e58595bcea4e..06adfdc61f1064c1ec0db34632a8740fc09a1782 100644 +index 1eebd3969735bff3e5559ed01ab4a2ec1c3c2de6..a7d8a6beb45bcc8be3e4a444ab1020783fba1635 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -6,6 +6,7 @@ import java.util.function.BooleanSupplier; diff --git a/patches/server/0025-Don-t-log-invalid-teams-to-console.patch b/patches/server/0025-Don-t-log-invalid-teams-to-console.patch index 5f0933c..4ed0818 100644 --- a/patches/server/0025-Don-t-log-invalid-teams-to-console.patch +++ b/patches/server/0025-Don-t-log-invalid-teams-to-console.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't log invalid teams to console diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 4bd7eea49a0720063db2a8ed10f53bd19e9499ad..953c2702880b358c0da4b8117c77b76bae849271 100644 +index 77275e948b3636d21cca8f59c35834e8fdb339c7..4bc677c5ab2cdcb1a235ecfab9468e7f1d7a96f3 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -861,7 +861,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -871,7 +871,7 @@ public abstract class LivingEntity extends Entity implements Attackable { boolean flag = scoreboardteam != null && this.level().getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam); if (!flag) { diff --git a/patches/server/0028-Add-spectator-teleport-event.patch b/patches/server/0028-Add-spectator-teleport-event.patch index b414d78..e84ca33 100644 --- a/patches/server/0028-Add-spectator-teleport-event.patch +++ b/patches/server/0028-Add-spectator-teleport-event.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add spectator teleport event diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 80e050603e36134754136a8ee2bd14624f976e91..a25b87311883c2fc2e9bd3707c79b88cbab0c3d9 100644 +index 88c57c1ef147045315e923a5ba3b6f9394900f92..689d82215dcf6d8dabba4ec6aa5154ec35a35d6d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1,5 +1,6 @@ @@ -15,7 +15,7 @@ index 80e050603e36134754136a8ee2bd14624f976e91..a25b87311883c2fc2e9bd3707c79b88c import com.google.common.collect.Lists; import com.google.common.primitives.Floats; import com.mojang.brigadier.ParseResults; -@@ -2101,6 +2102,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2136,6 +2137,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic Entity entity = packet.getEntity(worldserver); if (entity != null) { @@ -27,6 +27,6 @@ index 80e050603e36134754136a8ee2bd14624f976e91..a25b87311883c2fc2e9bd3707c79b88c + } + // Scissors end + - this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit + io.papermc.paper.threadedregions.TeleportUtils.teleport(this.player, false, entity, null, null, Entity.TELEPORT_FLAG_LOAD_CHUNK, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE, null); // Folia - region threading return; } diff --git a/patches/server/0029-Prevent-invalid-container-events.patch b/patches/server/0029-Prevent-invalid-container-events.patch index 7032b77..c526f91 100644 --- a/patches/server/0029-Prevent-invalid-container-events.patch +++ b/patches/server/0029-Prevent-invalid-container-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent invalid container events diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ad24f48d9d3d633d37d42978ded3c98a4a447e50..e3691dfadf6290775eaedd24383e02aeec5d0a9f 100644 +index 689d82215dcf6d8dabba4ec6aa5154ec35a35d6d..160af0dc759a643fcf0e948a2dec797b9d8c1683 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -30,6 +30,7 @@ import java.util.function.UnaryOperator; @@ -16,7 +16,7 @@ index ad24f48d9d3d633d37d42978ded3c98a4a447e50..e3691dfadf6290775eaedd24383e02ae import net.minecraft.ChatFormatting; import net.minecraft.CrashReport; import net.minecraft.CrashReportCategory; -@@ -3046,6 +3047,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3101,6 +3102,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } diff --git a/patches/server/0031-Validate-block-entity-entity-tag-query-positions.patch b/patches/server/0031-Validate-block-entity-entity-tag-query-positions.patch index 78d47d6..2317a51 100644 --- a/patches/server/0031-Validate-block-entity-entity-tag-query-positions.patch +++ b/patches/server/0031-Validate-block-entity-entity-tag-query-positions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity/entity tag query positions diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ac0a79d48b721e00690dcdfe02fa3c631a5936f8..5903534f1245b0aaeff0f1ea29e63bb224877787 100644 +index 160af0dc759a643fcf0e948a2dec797b9d8c1683..8774008ab8de09517ec0c345caf6ea2e269307e6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1364,7 +1364,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1398,7 +1398,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (this.player.hasPermissions(2)) { Entity entity = this.player.level().getEntity(packet.getEntityId()); @@ -17,7 +17,7 @@ index ac0a79d48b721e00690dcdfe02fa3c631a5936f8..5903534f1245b0aaeff0f1ea29e63bb2 CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag()); this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound)); -@@ -1376,7 +1376,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1410,7 +1410,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0034-Prevent-velocity-freeze.patch b/patches/server/0034-Prevent-velocity-freeze.patch index 71456b4..16fb294 100644 --- a/patches/server/0034-Prevent-velocity-freeze.patch +++ b/patches/server/0034-Prevent-velocity-freeze.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent velocity freeze diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -index 6c9a8f062f989db022154155e8a05b334a0510da..978fad27ad17de03d108ade2c2bfa464b7d83491 100644 +index 77f55bcb120295fa11140681f63175d37d8a78e2..fbdc893c2e8c3b668ad65d1304c889a2cc8eca27 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java @@ -1,5 +1,6 @@ @@ -32,7 +32,7 @@ index 6c9a8f062f989db022154155e8a05b334a0510da..978fad27ad17de03d108ade2c2bfa464 } } -@@ -141,6 +146,25 @@ public abstract class AbstractHurtingProjectile extends Projectile { +@@ -146,6 +151,25 @@ public abstract class AbstractHurtingProjectile extends Projectile { nbt.put("power", this.newDoubleList(new double[]{this.xPower, this.yPower, this.zPower})); } @@ -58,7 +58,7 @@ index 6c9a8f062f989db022154155e8a05b334a0510da..978fad27ad17de03d108ade2c2bfa464 @Override public void readAdditionalSaveData(CompoundTag nbt) { super.readAdditionalSaveData(nbt); -@@ -148,9 +172,13 @@ public abstract class AbstractHurtingProjectile extends Projectile { +@@ -153,9 +177,13 @@ public abstract class AbstractHurtingProjectile extends Projectile { ListTag nbttaglist = nbt.getList("power", 6); if (nbttaglist.size() == 3) { @@ -75,7 +75,7 @@ index 6c9a8f062f989db022154155e8a05b334a0510da..978fad27ad17de03d108ade2c2bfa464 } } -@@ -184,9 +212,13 @@ public abstract class AbstractHurtingProjectile extends Projectile { +@@ -189,9 +217,13 @@ public abstract class AbstractHurtingProjectile extends Projectile { Vec3 vec3d = entity.getLookAngle(); this.setDeltaMovement(vec3d); diff --git a/patches/server/0035-Add-configuration-option-to-disable-chat-signatures.patch b/patches/server/0035-Add-configuration-option-to-disable-chat-signatures.patch index e290aa3..8d81a32 100644 --- a/patches/server/0035-Add-configuration-option-to-disable-chat-signatures.patch +++ b/patches/server/0035-Add-configuration-option-to-disable-chat-signatures.patch @@ -60,7 +60,7 @@ index c0a80824a0307ea673805015119cc834b268f0dc..9f28f86b1b56ea55ab39f6ac988c1f47 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa8f073e08 100644 +index 8774008ab8de09517ec0c345caf6ea2e269307e6..2cda6420dfd24dc452bc2a2d27b5893fa832250a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1,5 +1,6 @@ @@ -70,7 +70,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors import com.google.common.collect.Lists; import com.google.common.primitives.Floats; -@@ -2356,7 +2357,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2392,7 +2393,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { @@ -79,7 +79,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes } else { this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); -@@ -2412,6 +2413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2448,6 +2449,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic Optional optional = this.lastSeenMessages.applyUpdate(acknowledgment); if (optional.isEmpty()) { @@ -87,7 +87,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes } -@@ -2641,6 +2643,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2679,6 +2681,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic synchronized (this.lastSeenMessages) { if (!this.lastSeenMessages.applyOffset(packet.offset())) { @@ -95,7 +95,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes } -@@ -3682,6 +3685,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3748,6 +3751,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0036-Patch-invalid-entity-rotation-log-spam.patch b/patches/server/0036-Patch-invalid-entity-rotation-log-spam.patch index 0a3123d..afaec31 100644 --- a/patches/server/0036-Patch-invalid-entity-rotation-log-spam.patch +++ b/patches/server/0036-Patch-invalid-entity-rotation-log-spam.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Patch invalid entity rotation log spam diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index afd25ef82b88521925d2b92286ab8fbda9983a0a..1d8c1090cffa7a7442d148b23a981ab10aaec712 100644 +index 4a07d55d2788508bb5849d01aac08ad281bb2060..fabaf91cb1c3f80001e5ccb9b1b93bf1eafe763f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4627,7 +4627,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -5417,7 +5417,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public void setXRot(float pitch) { if (!Float.isFinite(pitch)) { diff --git a/patches/server/0039-Limit-map-decorations.patch b/patches/server/0039-Limit-map-decorations.patch index 027190b..3e111c3 100644 --- a/patches/server/0039-Limit-map-decorations.patch +++ b/patches/server/0039-Limit-map-decorations.patch @@ -29,10 +29,10 @@ index 347d2914f9560a3ee8cea59444bc0dfbb7cf3456..b6a38b1458957bd444fea439fa81d297 this.x = x; this.y = z; diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index 3b12030b49b1c539684d75ca3896eb498400ef99..0d55d73bd31747ad9579aebbb77f315aa3dc2bc8 100644 +index 2b862066388cfede202a0c709f93ae89e2d17b30..465be29b3586dde779acfa44fe126850ccae3789 100644 --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -@@ -354,6 +354,11 @@ public class MapItemSavedData extends SavedData { +@@ -355,6 +355,11 @@ public class MapItemSavedData extends SavedData { } private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) { diff --git a/patches/server/0040-Prevent-player-banning-using-duplicate-UUIDs.patch b/patches/server/0040-Prevent-player-banning-using-duplicate-UUIDs.patch index b184817..f1bda16 100644 --- a/patches/server/0040-Prevent-player-banning-using-duplicate-UUIDs.patch +++ b/patches/server/0040-Prevent-player-banning-using-duplicate-UUIDs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent player banning using duplicate UUIDs diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 18aac3da3c88f33b1a71a5920a8daa27e9723913..b1bfb12f10d6fec9ca905498b4a6768997867311 100644 +index cf8f93734121e5c1959959f0ba13ee4e6db31959..e9a7755ec85eef3e9cc05b4deb6dfe10954bcadd 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1610,7 +1610,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1690,7 +1690,13 @@ public class ServerLevel extends Level implements WorldGenLevel { if (entity != null) { ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID().toString()); entity.unRide(); diff --git a/patches/server/0041-Don-t-warn-on-duplicate-entity-UUIDs.patch b/patches/server/0041-Don-t-warn-on-duplicate-entity-UUIDs.patch index 1014f85..a9e8adb 100644 --- a/patches/server/0041-Don-t-warn-on-duplicate-entity-UUIDs.patch +++ b/patches/server/0041-Don-t-warn-on-duplicate-entity-UUIDs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't warn on duplicate entity UUIDs diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java -index 41791c7331c80d496cde4e3d1846a178bef0bbe3..d04181bda85dbaa77d3b55b04b25519496bec4ff 100644 +index 0cdf092d5c3f65a23e26f201768c0e2fea1ffe09..cfed22910f3b73c0dc115b7887bd5b117749a939 100644 --- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java +++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java -@@ -372,7 +372,7 @@ public final class EntityLookup implements LevelEntityGetter { +@@ -416,7 +416,7 @@ public final class EntityLookup implements LevelEntityGetter { return false; } if (this.entityByUUID.containsKey(entity.getUUID())) { diff --git a/patches/server/0044-Implement-command-block-events.patch b/patches/server/0044-Implement-command-block-events.patch index 1625122..21f07e4 100644 --- a/patches/server/0044-Implement-command-block-events.patch +++ b/patches/server/0044-Implement-command-block-events.patch @@ -18,7 +18,7 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400 private final boolean trackOutput; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 52fafac90771554661ca4e0640fc1c7ca811bf6b..22e9ad5a55d43c91528c302c02725acb72bc1199 100644 +index 2cda6420dfd24dc452bc2a2d27b5893fa832250a..28af6c160120d0952928e312314d8f847f659207 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1,6 +1,8 @@ @@ -47,7 +47,7 @@ index 52fafac90771554661ca4e0640fc1c7ca811bf6b..22e9ad5a55d43c91528c302c02725acb import org.slf4j.Logger; // CraftBukkit start -@@ -1002,6 +1007,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1024,6 +1029,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity); } @@ -64,7 +64,7 @@ index 52fafac90771554661ca4e0640fc1c7ca811bf6b..22e9ad5a55d43c91528c302c02725acb commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.setTrackOutput(flag); if (!flag) { -@@ -1033,7 +1048,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1055,7 +1070,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level()); if (commandblocklistenerabstract != null) { diff --git a/patches/server/0048-Don-t-log-on-too-many-chained-updates.patch b/patches/server/0048-Don-t-log-on-too-many-chained-updates.patch index e4fc6de..f16d45e 100644 --- a/patches/server/0048-Don-t-log-on-too-many-chained-updates.patch +++ b/patches/server/0048-Don-t-log-on-too-many-chained-updates.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't log on too many chained updates diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java -index ec81be70cd6f92bbf9011395cb361f0ce54c5ad0..97da1db83dca24759b52fc2d0a360187dbef86f1 100644 +index 5ddd8108e077bc7c1a9524854ac591c6ab99c174..b6577352c043b44df2e32a35a6af2711339f15eb 100644 --- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java +++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java -@@ -56,7 +56,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater { +@@ -57,7 +57,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater { this.stack.push(entry); } } else if (this.count - 1 == this.maxChainedNeighborUpdates) { diff --git a/patches/server/0049-Fix-packet-related-lag-exploits.patch b/patches/server/0049-Fix-packet-related-lag-exploits.patch index c9c8943..147638c 100644 --- a/patches/server/0049-Fix-packet-related-lag-exploits.patch +++ b/patches/server/0049-Fix-packet-related-lag-exploits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee6a4b1c85 100644 +index 28af6c160120d0952928e312314d8f847f659207..d153e270baf88579c4bc8e023531db4f1ce38215 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -967,7 +967,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -989,7 +989,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); } else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); @@ -17,7 +17,7 @@ index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee BaseCommandBlock commandblocklistenerabstract = null; CommandBlockEntity tileentitycommand = null; BlockPos blockposition = packet.getPos(); -@@ -1127,7 +1127,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1149,7 +1149,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -26,7 +26,7 @@ index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee BlockPos blockposition = packet.getPos(); BlockState iblockdata = this.player.level().getBlockState(blockposition); BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); -@@ -1185,7 +1185,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1207,7 +1207,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -35,7 +35,7 @@ index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee BlockPos blockposition = packet.getPos(); BlockState iblockdata = this.player.level().getBlockState(blockposition); BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); -@@ -1208,7 +1208,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1230,7 +1230,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());