From 9b193ef9eeb74ec7cda0d8804d9f95ceefe78e9c Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Tue, 13 Feb 2024 15:52:00 -0600 Subject: [PATCH] Cleanup and reauthor patches --- ...0003-Add-Scissors-configuration-file.patch | 4 ++-- patches/server/0001-Build-changes.patch | 6 ++--- patches/server/0002-UUID-validation.patch | 2 +- ...aused-by-invalid-entities-in-beehive.patch | 2 +- .../0004-ResourceLocation-validation.patch | 2 +- ...Removes-useless-spammy-error-logging.patch | 2 +- ...id-items-in-HoverEvent-and-ItemFrame.patch | 2 +- ...-handling-of-invalid-JSON-components.patch | 6 ++--- ...-Scissors-configuration-file-command.patch | 10 ++++----- .../0014-Block-server-side-chunkbans.patch | 2 +- ...ery-player-data-in-the-nbt-component.patch | 2 +- .../0019-Fix-negative-death-times.patch | 4 ++-- patches/server/0022-Reset-large-tags.patch | 10 ++++----- ...3-Don-t-log-invalid-teams-to-console.patch | 4 ++-- .../0025-Add-MasterBlockFireEvent.patch | 2 +- ...vents-on-Signs-bypassing-permissions.patch | 2 +- .../server/0032-Prevent-velocity-freeze.patch | 2 +- ...on-option-to-disable-chat-signatures.patch | 2 +- ...-Patch-large-selector-distance-crash.patch | 2 +- ...tch-invalid-entity-rotation-log-spam.patch | 4 ++-- .../0040-Implement-command-block-events.patch | 2 +- ...h-limit-to-Component-deserialization.patch | 22 +++++-------------- ...-limit-to-updateCustomBlockEntityTag.patch | 13 ++--------- 23 files changed, 44 insertions(+), 65 deletions(-) diff --git a/patches/api/0003-Add-Scissors-configuration-file.patch b/patches/api/0003-Add-Scissors-configuration-file.patch index bf6b224..c539ef6 100644 --- a/patches/api/0003-Add-Scissors-configuration-file.patch +++ b/patches/api/0003-Add-Scissors-configuration-file.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Scissors configuration file diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 9af4bc16da09e59009c47911219e99450cdf2aa5..94244872f7cd6b4a6df709c0f68b1f484538c159 100644 +index b4f8281d3797ec825a7671f38077cd65d5a1d76e..da2c8e7f9c905f99f8bd72f9da52f34121561d99 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2198,6 +2198,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2214,6 +2214,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi } // Paper end diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 53fa7c3..24279ac 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -95,7 +95,7 @@ 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 90ae7e8c81f6a9ede8aeaeec3bf784023522cefc..e45581fca389f9f9ffb417d1cb2675c52999c454 100644 +index d06185566b447c432d4dc2e3ba04d121bcdbc71b..d5ade9e928a00d18b6dc8a3a9c5679f7b161a2fc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1855,7 +1855,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +From: Video Date: Sun, 10 Dec 2023 13:11:22 -0600 Subject: [PATCH] UUID validation diff --git a/patches/server/0003-Fixes-log-spam-caused-by-invalid-entities-in-beehive.patch b/patches/server/0003-Fixes-log-spam-caused-by-invalid-entities-in-beehive.patch index 83e3e2f..61f6ad6 100644 --- a/patches/server/0003-Fixes-log-spam-caused-by-invalid-entities-in-beehive.patch +++ b/patches/server/0003-Fixes-log-spam-caused-by-invalid-entities-in-beehive.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Video Date: Sun, 10 Dec 2023 16:57:48 -0600 Subject: [PATCH] Fixes log spam caused by invalid entities in beehives diff --git a/patches/server/0004-ResourceLocation-validation.patch b/patches/server/0004-ResourceLocation-validation.patch index 297d0d4..df1e860 100644 --- a/patches/server/0004-ResourceLocation-validation.patch +++ b/patches/server/0004-ResourceLocation-validation.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Video Date: Wed, 24 Jan 2024 16:28:16 -0600 Subject: [PATCH] ResourceLocation validation diff --git a/patches/server/0005-Removes-useless-spammy-error-logging.patch b/patches/server/0005-Removes-useless-spammy-error-logging.patch index c992d1a..753e01b 100644 --- a/patches/server/0005-Removes-useless-spammy-error-logging.patch +++ b/patches/server/0005-Removes-useless-spammy-error-logging.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Video Date: Sun, 10 Dec 2023 16:58:55 -0600 Subject: [PATCH] Removes useless spammy error logging diff --git a/patches/server/0010-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch b/patches/server/0010-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch index fe8f23f..fb699dc 100644 --- a/patches/server/0010-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch +++ b/patches/server/0010-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Luna Date: Sun, 10 Dec 2023 17:13:15 -0600 Subject: [PATCH] Do not log invalid items in HoverEvent and ItemFrame diff --git a/patches/server/0011-Better-handling-of-invalid-JSON-components.patch b/patches/server/0011-Better-handling-of-invalid-JSON-components.patch index 9c8b855..60c4e02 100644 --- a/patches/server/0011-Better-handling-of-invalid-JSON-components.patch +++ b/patches/server/0011-Better-handling-of-invalid-JSON-components.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Video Date: Sun, 10 Dec 2023 17:26:11 -0600 Subject: [PATCH] Better handling of invalid JSON components @@ -93,10 +93,10 @@ index 186547674894fd084bceb478bb6017b747df4173..74c880425964da042ca57c097eb93273 } }).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 9ee1e3da1cb16291ff3e37829e25227a6b97a177..1772313459992523eefd6b05bfb0b7ee33114469 100644 +index 906eded9a2ab61737a30cfe89292a71237ce4eb7..ea36187ed37d59edd2481de79372599a85f04e97 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2525,11 +2525,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2529,11 +2529,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (nbt.contains("CustomName", 8)) { String s = nbt.getString("CustomName"); diff --git a/patches/server/0013-Add-Scissors-configuration-file-command.patch b/patches/server/0013-Add-Scissors-configuration-file-command.patch index fb61638..d5a30a2 100644 --- a/patches/server/0013-Add-Scissors-configuration-file-command.patch +++ b/patches/server/0013-Add-Scissors-configuration-file-command.patch @@ -426,7 +426,7 @@ index 61840cfd64caba6595dfc99c91c76a195638d4ee..9acd9ecac6d72701835e04a17fddade7 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 2ecf79086e9e8069f43120e9146e98962a75eca8..5d3c324fd3224944639a3cfa808e89a8a8519b8d 100644 +index 68d268b6fff126e8645b6deec3fb549ea2286b77..5cb58e351d38b7214e2002bf608512024744f0ee 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 2ecf79086e9e8069f43120e9146e98962a75eca8..5d3c324fd3224944639a3cfa808e89a8 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 cc96cc142f37c5aa6ce8a1ce5e84e81ec33b78e1..66f1b9006cce0ea699e866d41eda5b40a5914438 100644 +index 55ffdca92ee796fb949de939bb759e09f25242ff..76189b4aba89c36b2d1a4fc397435de746d95f05 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1041,6 +1041,7 @@ public final class CraftServer implements Server { +@@ -1053,6 +1053,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot @@ -458,7 +458,7 @@ index cc96cc142f37c5aa6ce8a1ce5e84e81ec33b78e1..66f1b9006cce0ea699e866d41eda5b40 this.console.paperConfigurations.reloadConfigs(this.console); for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty -@@ -1072,6 +1073,7 @@ public final class CraftServer implements Server { +@@ -1084,6 +1085,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 cc96cc142f37c5aa6ce8a1ce5e84e81ec33b78e1..66f1b9006cce0ea699e866d41eda5b40 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -3001,6 +3003,14 @@ public final class CraftServer implements Server { +@@ -3013,6 +3015,14 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } diff --git a/patches/server/0014-Block-server-side-chunkbans.patch b/patches/server/0014-Block-server-side-chunkbans.patch index 148632a..7564631 100644 --- a/patches/server/0014-Block-server-side-chunkbans.patch +++ b/patches/server/0014-Block-server-side-chunkbans.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: ayunami2000 Date: Thu, 25 Jan 2024 23:48:51 -0600 Subject: [PATCH] Block server-side chunkbans diff --git a/patches/server/0016-Don-t-query-player-data-in-the-nbt-component.patch b/patches/server/0016-Don-t-query-player-data-in-the-nbt-component.patch index 06460d9..5123ca5 100644 --- a/patches/server/0016-Don-t-query-player-data-in-the-nbt-component.patch +++ b/patches/server/0016-Don-t-query-player-data-in-the-nbt-component.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Video Date: Sun, 10 Dec 2023 17:39:52 -0600 Subject: [PATCH] Don't query player data in the `nbt` component diff --git a/patches/server/0019-Fix-negative-death-times.patch b/patches/server/0019-Fix-negative-death-times.patch index 957ca51..f1f59a5 100644 --- a/patches/server/0019-Fix-negative-death-times.patch +++ b/patches/server/0019-Fix-negative-death-times.patch @@ -5,10 +5,10 @@ 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 6523795e715e5d472739e9bc6433143115c3de8f..12d6c53adcdf773ff95190c7936a3c5a3f26e9bf 100644 +index 902c0e7f2a167845f46adef4578bc71ca8cabfe8..454099b94ecf0f93f4d646610696b7af212b2170 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -627,7 +627,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -628,7 +628,7 @@ public abstract class LivingEntity extends Entity implements Attackable { protected void tickDeath() { ++this.deathTime; diff --git a/patches/server/0022-Reset-large-tags.patch b/patches/server/0022-Reset-large-tags.patch index 8a74455..e169921 100644 --- a/patches/server/0022-Reset-large-tags.patch +++ b/patches/server/0022-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 ed27a963223bfe18310ad5adabf461b5e307ef9c..1af25c1e91e1a93c6c6c8445a1d9fbeb4f15916b 100644 +index 1ad126d992d95062a3db08374db7a927f23a0cac..345fb9722f1dc8293809256d3bb87b8964b54164 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -23,6 +23,7 @@ import java.util.function.Predicate; @@ -70,7 +70,7 @@ index ed27a963223bfe18310ad5adabf461b5e307ef9c..1af25c1e91e1a93c6c6c8445a1d9fbeb import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.advancements.CriteriaTriggers; -@@ -277,6 +278,12 @@ public final class ItemStack { +@@ -278,6 +279,12 @@ public final class ItemStack { // CraftBukkit - break into own method private void load(CompoundTag nbttagcompound) { @@ -83,7 +83,7 @@ index ed27a963223bfe18310ad5adabf461b5e307ef9c..1af25c1e91e1a93c6c6c8445a1d9fbeb this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id"))); this.count = nbttagcompound.getByte("Count"); if (nbttagcompound.contains("tag", 10)) { -@@ -584,7 +591,11 @@ public final class ItemStack { +@@ -585,7 +592,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 ed27a963223bfe18310ad5adabf461b5e307ef9c..1af25c1e91e1a93c6c6c8445a1d9fbeb } return nbt; -@@ -918,6 +929,7 @@ public final class ItemStack { +@@ -919,6 +930,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 bc01481ac5990ad1cfd1def5a16dd0ed2f9de8c9..5948d7f87c2f2021345d58db18ec1c996ae8bf7a 100644 +index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..bdbe623ec5d3a5471e909c9933cf556a796354b6 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; diff --git a/patches/server/0023-Don-t-log-invalid-teams-to-console.patch b/patches/server/0023-Don-t-log-invalid-teams-to-console.patch index d4d2cc9..ae0111b 100644 --- a/patches/server/0023-Don-t-log-invalid-teams-to-console.patch +++ b/patches/server/0023-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 12d6c53adcdf773ff95190c7936a3c5a3f26e9bf..d9603cfc81b2f0b77a85a5dd99ae2db013937b14 100644 +index 454099b94ecf0f93f4d646610696b7af212b2170..0cadc29b9741b339d9a86f51b2009a645d0584c0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -860,7 +860,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -861,7 +861,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/0025-Add-MasterBlockFireEvent.patch b/patches/server/0025-Add-MasterBlockFireEvent.patch index 2769c6a..d2d7e06 100644 --- a/patches/server/0025-Add-MasterBlockFireEvent.patch +++ b/patches/server/0025-Add-MasterBlockFireEvent.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Allink Date: Sun, 10 Dec 2023 18:11:55 -0600 Subject: [PATCH] Add MasterBlockFireEvent diff --git a/patches/server/0031-Fix-ClickEvents-on-Signs-bypassing-permissions.patch b/patches/server/0031-Fix-ClickEvents-on-Signs-bypassing-permissions.patch index ee2cd46..2b0a29e 100644 --- a/patches/server/0031-Fix-ClickEvents-on-Signs-bypassing-permissions.patch +++ b/patches/server/0031-Fix-ClickEvents-on-Signs-bypassing-permissions.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Allink Date: Tue, 23 Jan 2024 19:04:22 -0600 Subject: [PATCH] Fix ClickEvents on Signs bypassing permissions diff --git a/patches/server/0032-Prevent-velocity-freeze.patch b/patches/server/0032-Prevent-velocity-freeze.patch index 3e2eea0..9c06f72 100644 --- a/patches/server/0032-Prevent-velocity-freeze.patch +++ b/patches/server/0032-Prevent-velocity-freeze.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Allink Date: Sun, 10 Dec 2023 18:41:18 -0600 Subject: [PATCH] Prevent velocity freeze diff --git a/patches/server/0033-Add-configuration-option-to-disable-chat-signatures.patch b/patches/server/0033-Add-configuration-option-to-disable-chat-signatures.patch index 4f9711c..71ba643 100644 --- a/patches/server/0033-Add-configuration-option-to-disable-chat-signatures.patch +++ b/patches/server/0033-Add-configuration-option-to-disable-chat-signatures.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Allink Date: Sun, 10 Dec 2023 18:48:55 -0600 Subject: [PATCH] Add configuration option to disable chat signatures diff --git a/patches/server/0034-Patch-large-selector-distance-crash.patch b/patches/server/0034-Patch-large-selector-distance-crash.patch index b2d3076..04ef222 100644 --- a/patches/server/0034-Patch-large-selector-distance-crash.patch +++ b/patches/server/0034-Patch-large-selector-distance-crash.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Luna Date: Sun, 10 Dec 2023 18:57:50 -0600 Subject: [PATCH] Patch large selector distance crash diff --git a/patches/server/0035-Patch-invalid-entity-rotation-log-spam.patch b/patches/server/0035-Patch-invalid-entity-rotation-log-spam.patch index a49f11c..8825221 100644 --- a/patches/server/0035-Patch-invalid-entity-rotation-log-spam.patch +++ b/patches/server/0035-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 fc6cff4121db4c08452817df846286103fe23ad9..3594e87329b99a2741749df04ac577a8fbe1a2fa 100644 +index ea36187ed37d59edd2481de79372599a85f04e97..133ce42e3c6574bdf922b43f7ab9516f79cbf64e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4732,7 +4732,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4735,7 +4735,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void setXRot(float pitch) { if (!Float.isFinite(pitch)) { diff --git a/patches/server/0040-Implement-command-block-events.patch b/patches/server/0040-Implement-command-block-events.patch index 3c55931..a11e06d 100644 --- a/patches/server/0040-Implement-command-block-events.patch +++ b/patches/server/0040-Implement-command-block-events.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo +From: Allink Date: Mon, 11 Dec 2023 12:27:44 -0600 Subject: [PATCH] Implement command block events diff --git a/patches/server/0051-Add-depth-limit-to-Component-deserialization.patch b/patches/server/0051-Add-depth-limit-to-Component-deserialization.patch index 0b46d32..9f84c4b 100644 --- a/patches/server/0051-Add-depth-limit-to-Component-deserialization.patch +++ b/patches/server/0051-Add-depth-limit-to-Component-deserialization.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add depth limit to Component deserialization diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java -index ba13650b52e39c9cc5cfa421f7720c7d4ba75678..f500b4aa5aaea89a2a878afe70d386f044401be4 100644 +index ba13650b52e39c9cc5cfa421f7720c7d4ba75678..df3c03aeaee5c12c5d57584535c9c7aa01be7dd3 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java +++ b/src/main/java/net/minecraft/network/chat/Component.java @@ -3,9 +3,11 @@ package net.minecraft.network.chat; @@ -47,26 +47,14 @@ index ba13650b52e39c9cc5cfa421f7720c7d4ba75678..f500b4aa5aaea89a2a878afe70d386f0 import java.util.stream.Stream; // CraftBukkit end -@@ -272,7 +278,8 @@ public interface Component extends Message, FormattedText, Iterable { - - public static class SerializerAdapter implements JsonDeserializer, JsonSerializer { - -- public SerializerAdapter() {} -+ public SerializerAdapter() { -+ } - - public MutableComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { - return Component.Serializer.deserialize(jsonelement); -@@ -286,10 +293,66 @@ public interface Component extends Message, FormattedText, Iterable { +@@ -286,10 +292,65 @@ public interface Component extends Message, FormattedText, Iterable { public static class Serializer { private static final Gson GSON = (new GsonBuilder()).disableHtmlEscaping().create(); + private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("%[0-9]+\\$s"); // Scissors -+ -+ private Serializer() { -+ } -- private Serializer() {} + private Serializer() {} + + // Scissors start + static int depthChecker(int depth) { + depth = depth + 1; @@ -83,7 +71,7 @@ index ba13650b52e39c9cc5cfa421f7720c7d4ba75678..f500b4aa5aaea89a2a878afe70d386f0 + } + return 0; + } - ++ static MutableComponent deserialize(JsonElement json) { + int depth = 1; + if (!json.isJsonPrimitive()) { diff --git a/patches/server/0052-Add-depth-limit-to-updateCustomBlockEntityTag.patch b/patches/server/0052-Add-depth-limit-to-updateCustomBlockEntityTag.patch index b9f41b9..a8c588e 100644 --- a/patches/server/0052-Add-depth-limit-to-updateCustomBlockEntityTag.patch +++ b/patches/server/0052-Add-depth-limit-to-updateCustomBlockEntityTag.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add depth limit to updateCustomBlockEntityTag diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index 8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f..a59b3e5dde7325e43b8041bccc51d370fdc17c55 100644 +index 8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f..75d31897711cf5917bc6f8082edddbb502c46a95 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java @@ -4,12 +4,19 @@ import java.util.Iterator; @@ -19,7 +19,7 @@ index 8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f..a59b3e5dde7325e43b8041bccc51d370 import java.util.stream.Stream; import javax.annotation.Nullable; + -+import me.totalfreedom.scissors.ScissorsConfig; ++import me.totalfreedom.scissors.ScissorsConfig; // Scissors import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; @@ -28,15 +28,6 @@ index 8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f..a59b3e5dde7325e43b8041bccc51d370 import net.minecraft.network.chat.Component; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; -@@ -98,7 +105,7 @@ public class BlockItem extends Item { - iblockdata1 = this.updateBlockStateFromTag(blockposition, world, itemstack, iblockdata1); - // Paper start - Reset placed block on exception - try { -- this.updateCustomBlockEntityTag(blockposition, world, entityhuman, itemstack, iblockdata1); -+ this.updateCustomBlockEntityTag(blockposition, world, entityhuman, itemstack, iblockdata1); - } catch (Exception e) { - oldBlockstate.update(true, false); - if (entityhuman instanceof ServerPlayer player) { @@ -240,6 +247,35 @@ public class BlockItem extends Item { if (nbttagcompound != null) { BlockEntity tileentity = world.getBlockEntity(pos);