diff --git a/gradle.properties b/gradle.properties index 3d4a02b..f6d4392 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=me.totalfreedom.scissors version=1.20.4-R0.1-SNAPSHOT mcVersion=1.20.4 -paperRef=5436d44bf2509ff89129f8790ee4643f09c72871 +paperRef=4445d23544e0801fb6f658de98815ce0d8c04f58 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0002-UUID-validation.patch b/patches/server/0002-UUID-validation.patch index 699121c..9243786 100644 --- a/patches/server/0002-UUID-validation.patch +++ b/patches/server/0002-UUID-validation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] UUID validation diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java -index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e53f359efa 100644 +index 9067bab8ec695417d479393f07d9bc6432427d73..433e586bed53a8c17adec74b3088899c748d4be3 100644 --- a/src/main/java/net/minecraft/network/chat/HoverEvent.java +++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java @@ -20,6 +20,7 @@ import net.minecraft.nbt.CompoundTag; @@ -16,7 +16,7 @@ index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e5 import net.minecraft.util.StringRepresentable; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; -@@ -161,7 +162,14 @@ public class HoverEvent { +@@ -148,7 +149,14 @@ public class HoverEvent { CompoundTag compoundTag = TagParser.parseTag(text.getString()); Component component = Component.Serializer.fromJson(compoundTag.getString("name")); EntityType entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type"))); @@ -31,4 +31,4 @@ index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e5 + // Scissors end return DataResult.success(new HoverEvent.EntityTooltipInfo(entityType, uUID, component)); } catch (Exception var5) { - return DataResult.error(() -> { + return DataResult.error(() -> "Failed to parse tooltip: " + var5.getMessage()); diff --git a/patches/server/0007-Fixes-Knowledge-Books-causing-log-spam-when-invalid-.patch b/patches/server/0007-Fixes-Knowledge-Books-causing-log-spam-when-invalid-.patch index 6ea9d3b..496fab5 100644 --- a/patches/server/0007-Fixes-Knowledge-Books-causing-log-spam-when-invalid-.patch +++ b/patches/server/0007-Fixes-Knowledge-Books-causing-log-spam-when-invalid-.patch @@ -6,17 +6,17 @@ Subject: [PATCH] Fixes Knowledge Books causing log spam when invalid data is diff --git a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java -index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8cadb437db4 100644 +index 5ebc309aed545a4c22970e617519fe916a29fa3c..14a35465e41c9ecb51bea5b084e2637ebd21d295 100644 --- a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java +++ b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java @@ -40,9 +40,9 @@ public class KnowledgeBookItem extends Item { - for(int i = 0; i < listTag.size(); ++i) { + for (int i = 0; i < listTag.size(); i++) { String string = listTag.getString(i); - Optional> optional = recipeManager.byKey(new ResourceLocation(string)); + Optional> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations if (!optional.isPresent()) { -- LOGGER.error("Invalid recipe: {}", (Object)string); +- LOGGER.error("Invalid recipe: {}", string); + // Scissors - Don't log errors caused by invalid recipes being provided return InteractionResultHolder.fail(itemStack); } @@ -25,7 +25,7 @@ index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8ca return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide()); } else { -- LOGGER.error("Tag not valid: {}", (Object)compoundTag); +- LOGGER.error("Tag not valid: {}", compoundTag); + // Scissors - Don't throw errors into the logs if an NBT compound isn't present or is missing the Recipes tag. return InteractionResultHolder.fail(itemStack); } diff --git a/patches/server/0008-Validate-BlockState-and-SoundEvent-values.patch b/patches/server/0008-Validate-BlockState-and-SoundEvent-values.patch index 7e0223f..974a75a 100644 --- a/patches/server/0008-Validate-BlockState-and-SoundEvent-values.patch +++ b/patches/server/0008-Validate-BlockState-and-SoundEvent-values.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate BlockState and SoundEvent values diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index e3a3f19a6e63fd42e29c418e5a7439972484d492..39866c58f9dbca9b4f0018922eac076c64ffbdae 100644 +index fe4bea6af0d8734f3a5b972dce5f1e3914d6690e..0ee64be4288f59240beec26c470b78cc1aeac424 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java -@@ -231,7 +231,7 @@ public final class NbtUtils { +@@ -223,7 +223,7 @@ public final class NbtUtils { return Blocks.AIR.defaultBlockState(); } else { // Paper start - Validate resource location diff --git a/patches/server/0009-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch b/patches/server/0009-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch deleted file mode 100644 index 65a4699..0000000 --- a/patches/server/0009-Do-not-log-invalid-items-in-HoverEvent-and-ItemFrame.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -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/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java -index b2cc15da40aa7bbcfc234b4e147ed0e53f359efa..dbe9f81e298a931c3e0e5b879dc13b493b3fdb52 100644 ---- a/src/main/java/net/minecraft/network/chat/HoverEvent.java -+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java -@@ -280,7 +280,7 @@ public class HoverEvent { - return DataResult.success(new HoverEvent.ItemStackInfo(ItemStack.of(compoundTag))); - } catch (CommandSyntaxException var2) { - return DataResult.error(() -> { -- return "Failed to parse item tag: " + var2.getMessage(); -+ return null; - }); - } - } -diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index 80303f9466b8c7097151be313afc9a383693d18a..a5235e9035768a588af522af645fa136c9c897cf 100644 ---- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -436,7 +436,7 @@ public class ItemFrame extends HangingEntity { - ItemStack itemstack = ItemStack.of(nbttagcompound1); - - if (itemstack.isEmpty()) { -- ItemFrame.LOGGER.warn("Unable to load item from: {}", nbttagcompound1); -+ // Scissors - ignore invalid items - } - - ItemStack itemstack1 = this.getItem(); diff --git a/patches/server/0011-Reject-oversized-components-from-updating.patch b/patches/server/0009-Reject-oversized-components-from-updating.patch similarity index 94% rename from patches/server/0011-Reject-oversized-components-from-updating.patch rename to patches/server/0009-Reject-oversized-components-from-updating.patch index 043e19a..0ca0230 100644 --- a/patches/server/0011-Reject-oversized-components-from-updating.patch +++ b/patches/server/0009-Reject-oversized-components-from-updating.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reject oversized components from updating diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java -index 57206594f305961a33542e1f8079c75bfa7c535f..ea4504be0eb115e563a4abd9dcbcedd57f9edcc2 100644 +index 3365aed2b67ae0e4dd0410f5190ba474f146139b..43b62a07b040b1d7d76dc8f940f35b51d1d5f868 100644 --- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java +++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java @@ -38,8 +38,9 @@ public class ComponentUtils { diff --git a/patches/server/0012-Add-Scissors-configuration-file-command.patch b/patches/server/0010-Add-Scissors-configuration-file-command.patch similarity index 100% rename from patches/server/0012-Add-Scissors-configuration-file-command.patch rename to patches/server/0010-Add-Scissors-configuration-file-command.patch diff --git a/patches/server/0010-Better-handling-of-invalid-JSON-components.patch b/patches/server/0010-Better-handling-of-invalid-JSON-components.patch deleted file mode 100644 index 9ee537c..0000000 --- a/patches/server/0010-Better-handling-of-invalid-JSON-components.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Video -Date: Sun, 10 Dec 2023 17:26:11 -0600 -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 e028353e0261310afc42ca0454b723d9f1ffc131..4e9366eee55236a08f1b8c56029c50e7b8c663de 100644 ---- a/src/main/java/io/papermc/paper/util/MCUtil.java -+++ b/src/main/java/io/papermc/paper/util/MCUtil.java -@@ -675,12 +675,6 @@ public final class MCUtil { - return null; - } - String string = compound.getString(key); -- try { -- return net.minecraft.network.chat.Component.Serializer.fromJson(string); -- } catch (com.google.gson.JsonParseException e) { -- org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); -- } -- -- return null; -+ return net.minecraft.network.chat.Component.Serializer.fromJsonSafe(string); - } - } -diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java -index d3a80d0a23be762c05931ae8001d98e43cab2b4a..ba13650b52e39c9cc5cfa421f7720c7d4ba75678 100644 ---- a/src/main/java/net/minecraft/network/chat/Component.java -+++ b/src/main/java/net/minecraft/network/chat/Component.java -@@ -23,6 +23,8 @@ import java.util.List; - import java.util.Optional; - import java.util.UUID; - import javax.annotation.Nullable; -+ -+import net.minecraft.ChatFormatting; - import net.minecraft.Util; - import net.minecraft.network.chat.contents.DataSource; - import net.minecraft.network.chat.contents.KeybindContents; -@@ -315,6 +317,26 @@ public interface Component extends Message, FormattedText, Iterable { - return json == null ? null : Serializer.deserialize(json); - } - -+ // Scissors start -+ @Nullable -+ public static MutableComponent fromJsonSafe(String json) { -+ try { -+ return fromJson(json); -+ } catch (Exception ex) { -+ return Component.empty().append("** Invalid JSON Component **").withStyle(ChatFormatting.RED); -+ } -+ } -+ -+ @Nullable -+ public static MutableComponent fromJsonSafe(JsonElement json) { -+ try { -+ return fromJson(json); -+ } catch (Exception ex) { -+ return Component.empty().append("** Invalid JSON Component **").withStyle(ChatFormatting.RED); -+ } -+ } -+ // Scissors end -+ - @Nullable - public static MutableComponent fromJsonLenient(String json) { - JsonReader jsonreader = new JsonReader(new StringReader(json)); -diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java -index dbe9f81e298a931c3e0e5b879dc13b493b3fdb52..6708290b6d096e8081c56d2e0da3c9ae2a112176 100644 ---- a/src/main/java/net/minecraft/network/chat/HoverEvent.java -+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java -@@ -160,7 +160,7 @@ public class HoverEvent { - public static DataResult legacyCreate(Component text) { - try { - CompoundTag compoundTag = TagParser.parseTag(text.getString()); -- Component component = Component.Serializer.fromJson(compoundTag.getString("name")); -+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("name")); // Scissors - Use safer method for getting Components from JSON - EntityType entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type"))); - // Scissors start - UUID uUID; -diff --git a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java -index 186547674894fd084bceb478bb6017b747df4173..74c880425964da042ca57c097eb93273da59ce7e 100644 ---- a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java -+++ b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java -@@ -115,10 +115,10 @@ public class NbtContents implements ComponentContents { - Component component = DataFixUtils.orElse(ComponentUtils.updateForEntity(source, this.separator, sender, depth), ComponentUtils.DEFAULT_NO_STYLE_SEPARATOR); - return stream.flatMap((text) -> { - try { -- MutableComponent mutableComponent = Component.Serializer.fromJson(text); -+ MutableComponent mutableComponent = Component.Serializer.fromJsonSafe(text); - return Stream.of(ComponentUtils.updateForEntity(source, mutableComponent, sender, depth)); - } catch (Exception var5) { -- LOGGER.warn("Failed to parse component: {}", text, var5); -+ // Scissors - don't log - return Stream.of(); - } - }).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 51097f1d04d981db2823e8647b546658b8fd27c1..2e32c600a04e0ad280a7ddcce23668afbd187a57 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2545,11 +2545,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S - if (nbt.contains("CustomName", 8)) { - String s = nbt.getString("CustomName"); - -- try { -- this.setCustomName(Component.Serializer.fromJson(s)); -- } catch (Exception exception) { -- Entity.LOGGER.warn("Failed to parse entity custom name {}", s, exception); -- } -+ this.setCustomName(Component.Serializer.fromJsonSafe(s)); // Scissors - Use safer method for getting Components from JSON - } - - this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible")); -diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java -index 6c3ed29e13ea78ceb1c9bb11ce0d9938bb8b4c62..ab2f9b9a021e05ad66a3701577862fa2acf81f52 100644 ---- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java -+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java -@@ -41,7 +41,7 @@ public class ScoreboardSaveData extends SavedData { - CompoundTag compoundTag = nbt.getCompound(i); - String string = compoundTag.getString("Name"); - PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string); -- Component component = Component.Serializer.fromJson(compoundTag.getString("DisplayName")); -+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("DisplayName")); // Scissors - Use safer method for getting Components from JSON - if (component != null) { - playerTeam.setDisplayName(component); - } -@@ -59,14 +59,14 @@ public class ScoreboardSaveData extends SavedData { - } - - if (compoundTag.contains("MemberNamePrefix", 8)) { -- Component component2 = Component.Serializer.fromJson(compoundTag.getString("MemberNamePrefix")); -+ Component component2 = Component.Serializer.fromJsonSafe(compoundTag.getString("MemberNamePrefix")); // Scissors - Use safer method for getting Components from JSON - if (component2 != null) { - playerTeam.setPlayerPrefix(component2); - } - } - - if (compoundTag.contains("MemberNameSuffix", 8)) { -- Component component3 = Component.Serializer.fromJson(compoundTag.getString("MemberNameSuffix")); -+ Component component3 = Component.Serializer.fromJsonSafe(compoundTag.getString("MemberNameSuffix")); // Scissors - Use safer method for getting Components from JSON - if (component3 != null) { - playerTeam.setPlayerSuffix(component3); - } -@@ -126,7 +126,7 @@ public class ScoreboardSaveData extends SavedData { - return ObjectiveCriteria.DUMMY; - }); - String string2 = compoundTag.getString("Name"); -- Component component = Component.Serializer.fromJson(compoundTag.getString("DisplayName")); -+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("DisplayName")); // Scissors - Use safer method for getting Components from JSON - ObjectiveCriteria.RenderType renderType = ObjectiveCriteria.RenderType.byId(compoundTag.getString("RenderType")); - boolean bl = compoundTag.getBoolean("display_auto_update"); - NumberFormat numberFormat = NumberFormatTypes.CODEC.parse(NbtOps.INSTANCE, compoundTag.get("format")).result().orElse((NumberFormat)null); diff --git a/patches/server/0013-Block-server-side-chunkbans.patch b/patches/server/0011-Block-server-side-chunkbans.patch similarity index 96% rename from patches/server/0013-Block-server-side-chunkbans.patch rename to patches/server/0011-Block-server-side-chunkbans.patch index 7564631..ae390a5 100644 --- a/patches/server/0013-Block-server-side-chunkbans.patch +++ b/patches/server/0011-Block-server-side-chunkbans.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Block server-side chunkbans diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java -index 85b8be8ffac0fb40e9cae0528271ed41473811c8..d0cfc4fc00d45c91380d2d794ca816db74d40266 100644 +index 96d5448019d53ac3575e209c1c5c223a62a2638d..d0cfc4fc00d45c91380d2d794ca816db74d40266 100644 --- a/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java @@ -7,8 +7,17 @@ import io.netty.handler.codec.MessageToByteEncoder; @@ -50,7 +50,7 @@ index 85b8be8ffac0fb40e9cae0528271ed41473811c8..d0cfc4fc00d45c91380d2d794ca816db protected void encode(ChannelHandlerContext channelHandlerContext, Packet packet, ByteBuf byteBuf) throws Exception { Attribute> attribute = channelHandlerContext.channel().attr(this.codecKey); ConnectionProtocol.CodecData codecData = attribute.get(); -@@ -34,46 +60,58 @@ public class PacketEncoder extends MessageToByteEncoder> { +@@ -34,45 +60,58 @@ public class PacketEncoder extends MessageToByteEncoder> { throw new IOException("Can't serialize unregistered packet"); } else { FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf); @@ -74,7 +74,10 @@ index 85b8be8ffac0fb40e9cae0528271ed41473811c8..d0cfc4fc00d45c91380d2d794ca816db - String packetName = io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(packet.getClass().getName()); - if (packetName.contains(".")) { - packetName = packetName.substring(packetName.lastIndexOf(".") + 1); -- } ++ packet = capPacket(packet, i); ++ if (packet == null) { ++ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet)); + } - - LOGGER.error("Packet encoding of packet {} (ID: {}) threw (skippable? {})", packetName, i, packet.isSkippable(), var13); - // Paper end @@ -88,16 +91,12 @@ index 85b8be8ffac0fb40e9cae0528271ed41473811c8..d0cfc4fc00d45c91380d2d794ca816db - int packetLength = friendlyByteBuf.readableBytes(); - if (packetLength > MAX_PACKET_SIZE) { - throw new PacketTooLargeException(packet, this.codecKey, packetLength); -+ packet = capPacket(packet, i); -+ if (packet == null) { -+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet)); - } +- } - // Paper end - Handle large packets disconnecting client - ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet); + friendlyByteBuf.clear(); + k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i); } -- + JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k); + ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet); + // Scissors end @@ -154,7 +153,7 @@ index 3944852921335c78a04a9dc301882ab5b152b1ed..96ee53c7cc862e059328c5cdf5e07f30 this.type = blockEntityType; this.tag = nbt.isEmpty() ? null : nbt; diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java -index 998deae645b4497c3285bfba3260c636439f9ecf..f419d4330ea55c1ed91c539a7884ee6814a16ca3 100644 +index 76bde683d193b37e563a67c1c7b9bdcf17d64524..185aa88ff28e6f3e3314abe19dff88609a47334e 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java @@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData { @@ -174,7 +173,7 @@ index 998deae645b4497c3285bfba3260c636439f9ecf..f419d4330ea55c1ed91c539a7884ee68 @@ -58,6 +65,7 @@ public class ClientboundLevelChunkPacketData { int totalTileEntities = 0; // Paper - Handle oversized block entities in chunks - for(Map.Entry entry2 : chunk.getBlockEntities().entrySet()) { + for (Entry entry2 : chunk.getBlockEntities().entrySet()) { + if (this.extraPackets.size() > 50) break; // Scissors - Limit extraPackets size // Paper start - Handle oversized block entities in chunks if (++totalTileEntities > TE_LIMIT) { diff --git a/patches/server/0014-Prevent-attributes-with-invalid-namespaces-from-bein.patch b/patches/server/0012-Prevent-attributes-with-invalid-namespaces-from-bein.patch similarity index 100% rename from patches/server/0014-Prevent-attributes-with-invalid-namespaces-from-bein.patch rename to patches/server/0012-Prevent-attributes-with-invalid-namespaces-from-bein.patch diff --git a/patches/server/0015-Don-t-query-player-data-in-the-nbt-component.patch b/patches/server/0013-Don-t-query-player-data-in-the-nbt-component.patch similarity index 93% rename from patches/server/0015-Don-t-query-player-data-in-the-nbt-component.patch rename to patches/server/0013-Don-t-query-player-data-in-the-nbt-component.patch index 5123ca5..7c28f4f 100644 --- a/patches/server/0015-Don-t-query-player-data-in-the-nbt-component.patch +++ b/patches/server/0013-Don-t-query-player-data-in-the-nbt-component.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't query player data in the `nbt` component diff --git a/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java b/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java -index 3bec895fecb3521653fb0b88d4a4854fd3766b46..5fd278ac13c02b9d511be22dba9719cb0cb0e17b 100644 +index 2750702cff35762bc817ffbe5bf81631e86bc49b..8714c3be77490a87aa6df0ff36a87557c6b99e25 100644 --- a/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java +++ b/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java @@ -8,12 +8,15 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; @@ -23,7 +23,7 @@ index 3bec895fecb3521653fb0b88d4a4854fd3766b46..5fd278ac13c02b9d511be22dba9719cb +import net.minecraft.world.entity.player.Player; public record EntityDataSource(String selectorPattern, @Nullable EntitySelector compiledSelector) implements DataSource { - public static final MapCodec SUB_CODEC = RecordCodecBuilder.mapCodec((instance) -> { + public static final MapCodec SUB_CODEC = RecordCodecBuilder.mapCodec( @@ -39,7 +42,11 @@ public record EntityDataSource(String selectorPattern, @Nullable EntitySelector public Stream getData(CommandSourceStack source) throws CommandSyntaxException { if (this.compiledSelector != null) { diff --git a/patches/server/0016-Limit-string-tag-visitors-to-1024-elements.patch b/patches/server/0014-Limit-string-tag-visitors-to-1024-elements.patch similarity index 84% rename from patches/server/0016-Limit-string-tag-visitors-to-1024-elements.patch rename to patches/server/0014-Limit-string-tag-visitors-to-1024-elements.patch index 255a727..933cbd6 100644 --- a/patches/server/0016-Limit-string-tag-visitors-to-1024-elements.patch +++ b/patches/server/0014-Limit-string-tag-visitors-to-1024-elements.patch @@ -5,32 +5,32 @@ Subject: [PATCH] Limit string tag visitors to 1024 elements diff --git a/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java b/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java -index e07cc7970955ce240754cfe424d768c2bba0241a..a4f41bb4ec6cb20f782668c714229b61415cfdfb 100644 +index b45bb4ddf6b586ba1285db230e0bc3d1b5e447e8..4a46935cac263325a87a1b0bf32302839a75516e 100644 --- a/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java +++ b/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java @@ -89,6 +89,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor { public void visitByteArray(ByteArrayTag element) { - StringBuilder stringBuilder = (new StringBuilder("[")).append("B").append(";"); + StringBuilder stringBuilder = new StringBuilder("[").append("B").append(";"); byte[] bs = element.getAsByteArray(); + if (bs.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors - for(int i = 0; i < bs.length; ++i) { - stringBuilder.append(" ").append((int)bs[i]).append("B"); + for (int i = 0; i < bs.length; i++) { + stringBuilder.append(" ").append(bs[i]).append("B"); @@ -105,6 +106,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor { public void visitIntArray(IntArrayTag element) { - StringBuilder stringBuilder = (new StringBuilder("[")).append("I").append(";"); + StringBuilder stringBuilder = new StringBuilder("[").append("I").append(";"); int[] is = element.getAsIntArray(); + if (is.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors - for(int i = 0; i < is.length; ++i) { + for (int i = 0; i < is.length; i++) { stringBuilder.append(" ").append(is[i]); @@ -122,6 +124,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor { String string = "L"; - StringBuilder stringBuilder = (new StringBuilder("[")).append("L").append(";"); + StringBuilder stringBuilder = new StringBuilder("[").append("L").append(";"); long[] ls = element.getAsLongArray(); + if (ls.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors - for(int i = 0; i < ls.length; ++i) { + for (int i = 0; i < ls.length; i++) { stringBuilder.append(" ").append(ls[i]).append("L"); @@ -136,7 +139,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor { @@ -51,7 +51,7 @@ index e07cc7970955ce240754cfe424d768c2bba0241a..a4f41bb4ec6cb20f782668c714229b61 } else { StringBuilder stringBuilder = new StringBuilder("{"); diff --git a/src/main/java/net/minecraft/nbt/StringTagVisitor.java b/src/main/java/net/minecraft/nbt/StringTagVisitor.java -index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a9940e327 100644 +index d8892641d5671fa100aeb43d42ebb6103a2d280c..d10242ecd6f8442e1af3f4cd13f769517b33058a 100644 --- a/src/main/java/net/minecraft/nbt/StringTagVisitor.java +++ b/src/main/java/net/minecraft/nbt/StringTagVisitor.java @@ -53,6 +53,7 @@ public class StringTagVisitor implements TagVisitor { @@ -60,7 +60,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a byte[] bs = element.getAsByteArray(); + if (bs.length > 1024) { this.builder.append(']'); return; } // Scissors - for(int i = 0; i < bs.length; ++i) { + for (int i = 0; i < bs.length; i++) { if (i != 0) { @@ -69,6 +70,7 @@ public class StringTagVisitor implements TagVisitor { public void visitIntArray(IntArrayTag element) { @@ -68,7 +68,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a int[] is = element.getAsIntArray(); + if (is.length > 1024) { this.builder.append(']'); return; } // Scissors - for(int i = 0; i < is.length; ++i) { + for (int i = 0; i < is.length; i++) { if (i != 0) { @@ -85,6 +87,7 @@ public class StringTagVisitor implements TagVisitor { public void visitLongArray(LongArrayTag element) { @@ -76,7 +76,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a long[] ls = element.getAsLongArray(); + if (ls.length > 1024) { this.builder.append(']'); return; } // Scissors - for(int i = 0; i < ls.length; ++i) { + for (int i = 0; i < ls.length; i++) { if (i != 0) { @@ -100,6 +103,7 @@ public class StringTagVisitor implements TagVisitor { @Override @@ -84,7 +84,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a this.builder.append('['); + if (element.size() > 1024) { this.builder.append(']'); return; } // Scissors - for(int i = 0; i < element.size(); ++i) { + for (int i = 0; i < element.size(); i++) { if (i != 0) { @@ -116,6 +120,7 @@ public class StringTagVisitor implements TagVisitor { public void visitCompound(CompoundTag compound) { @@ -93,9 +93,9 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a + if (list.size() > 1024) { this.builder.append('}'); return; } // Scissors Collections.sort(list); - for(String string : list) { + for (String string : list) { diff --git a/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java b/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java -index 149def3da0b92f64e4fc04630965dce44884f938..c9d753f37bd65e35f8a4e2eb5c6fe8f74d5d1606 100644 +index 4e238ae29347c5e976ff0d506e94972df0aa7362..9776b9741a7ec46c603b2c2bccd5f006c15cee41 100644 --- a/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java +++ b/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java @@ -97,6 +97,7 @@ public class TextComponentTagVisitor implements TagVisitor { @@ -104,15 +104,15 @@ index 149def3da0b92f64e4fc04630965dce44884f938..c9d753f37bd65e35f8a4e2eb5c6fe8f7 byte[] bs = element.getAsByteArray(); + if (bs.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors - for(int i = 0; i < bs.length; ++i) { - MutableComponent mutableComponent2 = Component.literal(String.valueOf((int)bs[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER); + for (int i = 0; i < bs.length; i++) { + MutableComponent mutableComponent2 = Component.literal(String.valueOf(bs[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER); @@ -115,6 +116,7 @@ public class TextComponentTagVisitor implements TagVisitor { Component component = Component.literal("I").withStyle(SYNTAX_HIGHLIGHTING_NUMBER_TYPE); MutableComponent mutableComponent = Component.literal("[").append(component).append(";"); int[] is = element.getAsIntArray(); + if (is.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors - for(int i = 0; i < is.length; ++i) { + for (int i = 0; i < is.length; i++) { mutableComponent.append(" ").append(Component.literal(String.valueOf(is[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER)); @@ -132,6 +134,7 @@ public class TextComponentTagVisitor implements TagVisitor { Component component = Component.literal("L").withStyle(SYNTAX_HIGHLIGHTING_NUMBER_TYPE); @@ -120,7 +120,7 @@ index 149def3da0b92f64e4fc04630965dce44884f938..c9d753f37bd65e35f8a4e2eb5c6fe8f7 long[] ls = element.getAsLongArray(); + if (ls.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors - for(int i = 0; i < ls.length; ++i) { + for (int i = 0; i < ls.length; i++) { Component component2 = Component.literal(String.valueOf(ls[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER); @@ -147,7 +150,7 @@ public class TextComponentTagVisitor implements TagVisitor { diff --git a/patches/server/0017-Fixes-creative-killing-potion-effects-and-certain-po.patch b/patches/server/0015-Fixes-creative-killing-potion-effects-and-certain-po.patch similarity index 100% rename from patches/server/0017-Fixes-creative-killing-potion-effects-and-certain-po.patch rename to patches/server/0015-Fixes-creative-killing-potion-effects-and-certain-po.patch diff --git a/patches/server/0018-Fix-negative-death-times.patch b/patches/server/0016-Fix-negative-death-times.patch similarity index 91% rename from patches/server/0018-Fix-negative-death-times.patch rename to patches/server/0016-Fix-negative-death-times.patch index 315d14b..3b883fd 100644 --- a/patches/server/0018-Fix-negative-death-times.patch +++ b/patches/server/0016-Fix-negative-death-times.patch @@ -5,7 +5,7 @@ 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 23570a0b1227a840b9c1e6ae326827ea655bb5f7..b95ea8c0ef66b1f8fad0de0e005bf2cf95da5808 100644 +index e9bb7feb591032904516d1b9374f486d8a7d066c..60961c54e870148b5c649045e7347ca1064b6bde 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 { diff --git a/patches/server/0019-Limit-amount-of-vehicle-collision-checks-to-3-and-di.patch b/patches/server/0017-Limit-amount-of-vehicle-collision-checks-to-3-and-di.patch similarity index 100% rename from patches/server/0019-Limit-amount-of-vehicle-collision-checks-to-3-and-di.patch rename to patches/server/0017-Limit-amount-of-vehicle-collision-checks-to-3-and-di.patch diff --git a/patches/server/0020-Add-custom-classes-used-by-Scissors.patch b/patches/server/0018-Add-custom-classes-used-by-Scissors.patch similarity index 100% rename from patches/server/0020-Add-custom-classes-used-by-Scissors.patch rename to patches/server/0018-Add-custom-classes-used-by-Scissors.patch diff --git a/patches/server/0022-Don-t-log-invalid-teams-to-console.patch b/patches/server/0019-Don-t-log-invalid-teams-to-console.patch similarity index 91% rename from patches/server/0022-Don-t-log-invalid-teams-to-console.patch rename to patches/server/0019-Don-t-log-invalid-teams-to-console.patch index 4a643aa..1ac1fc8 100644 --- a/patches/server/0022-Don-t-log-invalid-teams-to-console.patch +++ b/patches/server/0019-Don-t-log-invalid-teams-to-console.patch @@ -5,7 +5,7 @@ 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 b95ea8c0ef66b1f8fad0de0e005bf2cf95da5808..1e833374f4abd649074b2b42067317f42cf78df6 100644 +index 60961c54e870148b5c649045e7347ca1064b6bde..0ce25857188029335d0afd0a9f0c22b79d4b0b69 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -869,7 +869,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0023-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch b/patches/server/0020-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch similarity index 92% rename from patches/server/0023-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch rename to patches/server/0020-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch index 046f751..969c192 100644 --- a/patches/server/0023-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch +++ b/patches/server/0020-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fixes out of bounds HangingEntity crash exploit diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java -index 2446d649225f96748e2fbb1a53a9e1902ac22aa1..76016cbbdff22592b76e827212b76021f3e39e13 100644 +index eaad15a4d201356c34c1a09c7fbe5c35f76a2176..e166411e05287d97ea7c9d35b19d4ae3106401c3 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java @@ -280,6 +280,13 @@ public abstract class HangingEntity extends Entity { diff --git a/patches/server/0024-Add-MasterBlockFireEvent.patch b/patches/server/0021-Add-MasterBlockFireEvent.patch similarity index 94% rename from patches/server/0024-Add-MasterBlockFireEvent.patch rename to patches/server/0021-Add-MasterBlockFireEvent.patch index d2d7e06..454e565 100644 --- a/patches/server/0024-Add-MasterBlockFireEvent.patch +++ b/patches/server/0021-Add-MasterBlockFireEvent.patch @@ -40,7 +40,7 @@ index 7ef14e4441a329c680a5dfe4bfb5033ffcb8f9d5..eff5bdf00b0aa7a9925ff59a62ead725 executor.performCommand(world); } else { diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java -index e2e31d6383c7de4f2eede46987d51978a5692639..9e5bb41c20e92cc39c99bfb3c801e9e432ba23cd 100644 +index 447b0359922011fe12b1bb9628d23a47c9d7dc89..0d6be671e1512074ae1265fe93a5d5437f3929dd 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java @@ -2,6 +2,8 @@ package net.minecraft.world.level.block.entity; @@ -60,7 +60,7 @@ index e2e31d6383c7de4f2eede46987d51978a5692639..9e5bb41c20e92cc39c99bfb3c801e9e4 public class JigsawBlockEntity extends BlockEntity { public static final String TARGET = "target"; -@@ -131,6 +134,16 @@ public class JigsawBlockEntity extends BlockEntity { +@@ -134,6 +137,16 @@ public class JigsawBlockEntity extends BlockEntity { } public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) { @@ -78,7 +78,7 @@ index e2e31d6383c7de4f2eede46987d51978a5692639..9e5bb41c20e92cc39c99bfb3c801e9e4 Registry registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL); // Paper start - Replace getHolderOrThrow with a null check diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java -index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb7262b474 100644 +index 29c59e4a1283ac211b18b953ed6c03834a2587bd..fb385cd66226200ed0b8439cb6659dbac6c2b229 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java @@ -5,6 +5,8 @@ import java.util.Objects; @@ -98,7 +98,7 @@ index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb public class StructureBlockEntity extends BlockEntity { private static final int SCAN_CORNER_BLOCKS_RANGE = 5; -@@ -261,7 +264,7 @@ public class StructureBlockEntity extends BlockEntity { +@@ -259,7 +262,7 @@ public class StructureBlockEntity extends BlockEntity { return false; } else { BlockPos blockPos = this.getBlockPos(); @@ -107,7 +107,7 @@ index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb BlockPos blockPos2 = new BlockPos(blockPos.getX() - 80, this.level.getMinBuildHeight(), blockPos.getZ() - 80); BlockPos blockPos3 = new BlockPos(blockPos.getX() + 80, this.level.getMaxBuildHeight() - 1, blockPos.getZ() + 80); Stream stream = this.getRelatedCorners(blockPos2, blockPos3); -@@ -320,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity { +@@ -316,6 +319,16 @@ public class StructureBlockEntity extends BlockEntity { if (this.structureName == null) { return false; } else { @@ -124,7 +124,7 @@ index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb BlockPos blockPos = this.getBlockPos().offset(this.structurePos); ServerLevel serverLevel = (ServerLevel)this.level; StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager(); -@@ -371,6 +384,16 @@ public class StructureBlockEntity extends BlockEntity { +@@ -367,6 +380,16 @@ public class StructureBlockEntity extends BlockEntity { if (structureTemplate == null) { return false; } else { diff --git a/patches/server/0021-Reset-large-tags.patch b/patches/server/0021-Reset-large-tags.patch deleted file mode 100644 index e25a169..0000000 --- a/patches/server/0021-Reset-large-tags.patch +++ /dev/null @@ -1,313 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Allink -Date: Mon, 18 Apr 2022 03:56:09 +0100 -Subject: [PATCH] Reset large tags - - -diff --git a/src/main/java/net/minecraft/world/ContainerHelper.java b/src/main/java/net/minecraft/world/ContainerHelper.java -index 4092c7a8c2b0d9d26e6f4d97386735236300d132..04c47cf1a920ae6c356449df801227ee14f6dfb7 100644 ---- a/src/main/java/net/minecraft/world/ContainerHelper.java -+++ b/src/main/java/net/minecraft/world/ContainerHelper.java -@@ -2,6 +2,7 @@ package net.minecraft.world; - - import java.util.List; - import java.util.function.Predicate; -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.NonNullList; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.nbt.ListTag; -@@ -22,10 +23,12 @@ public class ContainerHelper { - - public static CompoundTag saveAllItems(CompoundTag nbt, NonNullList stacks, boolean setIfEmpty) { - ListTag listTag = new ListTag(); -+ long total = 0; // Scissors - - for(int i = 0; i < stacks.size(); ++i) { - ItemStack itemStack = stacks.get(i); - if (!itemStack.isEmpty()) { -+ total += NbtUtility.getTagSize(itemStack.getTag()); // Scissors - CompoundTag compoundTag = new CompoundTag(); - compoundTag.putByte("Slot", (byte)i); - itemStack.save(compoundTag); -@@ -33,7 +36,7 @@ public class ContainerHelper { - } - } - -- if (!listTag.isEmpty() || setIfEmpty) { -+ if ((!listTag.isEmpty() || setIfEmpty) && !(total > NbtUtility.MAXIMUM_SIZE)) { // Scissors - nbt.put("Items", listTag); - } - -@@ -42,11 +45,19 @@ public class ContainerHelper { - - public static void loadAllItems(CompoundTag nbt, NonNullList stacks) { - ListTag listTag = nbt.getList("Items", 10); -+ long total = 0; // Scissors - Account for items inside containers - - for(int i = 0; i < listTag.size(); ++i) { - CompoundTag compoundTag = listTag.getCompound(i); - int j = compoundTag.getByte("Slot") & 255; - if (j >= 0 && j < stacks.size()) { -+ // Scissors start -+ total += NbtUtility.getTagSize(compoundTag); -+ if (total >= NbtUtility.MAXIMUM_SIZE) { -+ stacks.clear(); -+ break; -+ } -+ // Scissors end - stacks.set(j, ItemStack.of(compoundTag)); - } - } -diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -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; - import java.util.stream.Collectors; - import java.util.stream.Stream; - import javax.annotation.Nullable; -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.ChatFormatting; - import net.minecraft.Util; - import net.minecraft.advancements.CriteriaTriggers; -@@ -278,6 +279,12 @@ public final class ItemStack { - - // CraftBukkit - break into own method - private void load(CompoundTag nbttagcompound) { -+ // Scissors start - Reset large tags -+ if (NbtUtility.isTooLarge(nbttagcompound)) { -+ // Reset tag without destroying item -+ nbttagcompound = NbtUtility.Item.removeItemData(nbttagcompound); -+ } -+ // Scissors end - this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id"))); - this.count = nbttagcompound.getByte("Count"); - if (nbttagcompound.contains("tag", 10)) { -@@ -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) { -- nbt.put("tag", this.tag.copy()); -+ // Scissors start - Don't save large tags -+ if (!NbtUtility.isTooLarge(this.tag)) { -+ nbt.put("tag", this.tag.copy()); -+ } -+ // Scissors end - } - - return nbt; -@@ -919,6 +930,7 @@ public final class ItemStack { - // Paper end - - public void setTag(@Nullable CompoundTag nbt) { -+ if (NbtUtility.isTooLarge(nbt)) return; // Scissors - Ignore large tags - this.tag = nbt; - this.processEnchantOrder(this.tag); // Paper - if (this.getItem().canBeDepleted()) { -diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 89d06253b00604114e543ebbe12a9993ae95dc41..2f17fa399dfff7e260fe552147fe88699ebff73e 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -9,6 +9,7 @@ import java.util.Iterator; - import java.util.List; - import java.util.Map; - import javax.annotation.Nullable; -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.SharedConstants; - import net.minecraft.Util; - import net.minecraft.core.BlockPos; -@@ -213,6 +214,17 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit - public List transaction = new java.util.ArrayList(); - - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.items) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.items.clear(); -+ } -+ // Scissors end - return this.items; - } - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java -index 416aa989ebb18a8741cc9d605a1180ab830f6643..a9a8c9e68e5b767dec2c26495685da88e0caa627 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java -@@ -1,5 +1,6 @@ - package net.minecraft.world.level.block.entity; - -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; - import net.minecraft.core.NonNullList; -@@ -34,6 +35,17 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity { - - @Override - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.items) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.items.clear(); -+ } -+ // Scissors end - return this.items; - } - -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 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; - import java.util.Arrays; - import java.util.Iterator; - import javax.annotation.Nullable; -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; - import net.minecraft.core.NonNullList; -@@ -73,6 +74,17 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements - } - - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.items) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.items.clear(); -+ } -+ // Scissors end - return this.items; - } - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java -index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..0f734147d0cb86ff6c8a4c28733cf4cb9b7856d4 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java -@@ -1,5 +1,6 @@ - package net.minecraft.world.level.block.entity; - -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; - import net.minecraft.core.NonNullList; -@@ -40,6 +41,17 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement - private int maxStack = MAX_STACK; - - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.items) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.items.clear(); -+ } -+ // Scissors end - return this.items; - } - -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..d0513b72cdaec3b67b9341d251367b193bafa40c 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java -@@ -1,5 +1,6 @@ - package net.minecraft.world.level.block.entity; - -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.BlockPos; - import net.minecraft.core.NonNullList; - import net.minecraft.nbt.CompoundTag; -@@ -28,6 +29,17 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity { - private int maxStack = MAX_STACK; - - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.items) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.items.clear(); -+ } -+ // Scissors end - return this.items; - } - -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 757edf74751dc7183454656fda9cecc4eb601e4c..005de26f9a8a67f29a474823515ee66730690b52 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; - import java.util.stream.Collectors; - import java.util.stream.IntStream; - import javax.annotation.Nullable; -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; - import net.minecraft.core.NonNullList; -@@ -57,6 +58,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - private int maxStack = MAX_STACK; - - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.items) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.items.clear(); -+ } -+ // Scissors end - return this.items; - } - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java -index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..9f12fbcd8d0c75de1d8c06bed2c64a0acdc877c9 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java -@@ -4,6 +4,7 @@ import java.util.Iterator; - import java.util.List; - import java.util.stream.IntStream; - import javax.annotation.Nullable; -+import me.totalfreedom.scissors.NbtUtility; // Scissors - import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; - import net.minecraft.core.NonNullList; -@@ -61,6 +62,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl - public boolean opened; - - public List getContents() { -+ // Scissors start - Account for items inside containers -+ long total = 0; -+ -+ for (ItemStack item : this.itemStacks) { -+ total += NbtUtility.getTagSize(item.getOrCreateTag()); -+ } -+ -+ if (total > NbtUtility.MAXIMUM_SIZE) { -+ this.itemStacks.clear(); -+ } -+ // Scissors end - return this.itemStacks; - } - diff --git a/patches/server/0025-Add-spectator-teleport-event.patch b/patches/server/0022-Add-spectator-teleport-event.patch similarity index 94% rename from patches/server/0025-Add-spectator-teleport-event.patch rename to patches/server/0022-Add-spectator-teleport-event.patch index c293c39..2a60d61 100644 --- a/patches/server/0025-Add-spectator-teleport-event.patch +++ b/patches/server/0022-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 ab5b259d8f72022c875cae73be25fe2da346c6b3..1c2b3042b0d7b012876e3d4aab4521915d2cda18 100644 +index 860d33ac56680babd87358b1d7d2216dac3f7865..a60f594b3d7c8c30344f5e888e4309b8f75fdeaf 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 @@ diff --git a/patches/server/0026-Prevent-invalid-container-events.patch b/patches/server/0023-Prevent-invalid-container-events.patch similarity index 95% rename from patches/server/0026-Prevent-invalid-container-events.patch rename to patches/server/0023-Prevent-invalid-container-events.patch index 3a87a32..04fbdd5 100644 --- a/patches/server/0026-Prevent-invalid-container-events.patch +++ b/patches/server/0023-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 d0a7490c153e7968c657a525908de58f60f26c20..807117124668040121c5252a10c33ad100c0b0da 100644 +index a60f594b3d7c8c30344f5e888e4309b8f75fdeaf..cfe4f98458c1b1fd311535552b99937d1f319c0e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -29,6 +29,7 @@ import java.util.function.UnaryOperator; diff --git a/patches/server/0027-Disable-running-commands-in-books-by-default.patch b/patches/server/0024-Disable-running-commands-in-books-by-default.patch similarity index 94% rename from patches/server/0027-Disable-running-commands-in-books-by-default.patch rename to patches/server/0024-Disable-running-commands-in-books-by-default.patch index 952d10b..206074d 100644 --- a/patches/server/0027-Disable-running-commands-in-books-by-default.patch +++ b/patches/server/0024-Disable-running-commands-in-books-by-default.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Disable running commands in books by default diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java -index 258a636a59203c4e5415a89002c6a607338f9514..dbc2993a105214d945a49e1eb5b910d28c09ae41 100644 +index 793ab8acd7445984cff2628e3f001661dc20c8e5..0e6e0d6a9c645db0121637262a6cf90172d3c385 100644 --- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java +++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java @@ -2,6 +2,7 @@ package net.minecraft.world.item; @@ -26,7 +26,7 @@ index 258a636a59203c4e5415a89002c6a607338f9514..dbc2993a105214d945a49e1eb5b910d2 import net.minecraft.stats.Stats; import net.minecraft.util.StringUtil; import net.minecraft.world.InteractionHand; -@@ -161,9 +161,43 @@ public class WrittenBookItem extends Item { +@@ -162,9 +162,43 @@ public class WrittenBookItem extends Item { component2 = Component.literal(text); } diff --git a/patches/server/0028-Validate-block-entity-entity-tag-query-positions.patch b/patches/server/0025-Validate-block-entity-entity-tag-query-positions.patch similarity index 95% rename from patches/server/0028-Validate-block-entity-entity-tag-query-positions.patch rename to patches/server/0025-Validate-block-entity-entity-tag-query-positions.patch index 4406477..36a4372 100644 --- a/patches/server/0028-Validate-block-entity-entity-tag-query-positions.patch +++ b/patches/server/0025-Validate-block-entity-entity-tag-query-positions.patch @@ -5,7 +5,7 @@ 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 a66ec293947fc852104dce93a418771b2f44106d..b324e9ac6bbbe691c0b3c2994f326c0aa06d7dd7 100644 +index cfe4f98458c1b1fd311535552b99937d1f319c0e..adbb1036913ba6299f2093c84480e4147a36b344 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1278,7 +1278,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0029-Refuse-to-convert-legacy-messages-over-1k-characters.patch b/patches/server/0026-Refuse-to-convert-legacy-messages-over-1k-characters.patch similarity index 100% rename from patches/server/0029-Refuse-to-convert-legacy-messages-over-1k-characters.patch rename to patches/server/0026-Refuse-to-convert-legacy-messages-over-1k-characters.patch diff --git a/patches/server/0030-Fix-ClickEvents-on-Signs-bypassing-permissions.patch b/patches/server/0027-Fix-ClickEvents-on-Signs-bypassing-permissions.patch similarity index 100% rename from patches/server/0030-Fix-ClickEvents-on-Signs-bypassing-permissions.patch rename to patches/server/0027-Fix-ClickEvents-on-Signs-bypassing-permissions.patch diff --git a/patches/server/0031-Prevent-velocity-freeze.patch b/patches/server/0028-Prevent-velocity-freeze.patch similarity index 100% rename from patches/server/0031-Prevent-velocity-freeze.patch rename to patches/server/0028-Prevent-velocity-freeze.patch diff --git a/patches/server/0033-Patch-large-selector-distance-crash.patch b/patches/server/0029-Patch-large-selector-distance-crash.patch similarity index 86% rename from patches/server/0033-Patch-large-selector-distance-crash.patch rename to patches/server/0029-Patch-large-selector-distance-crash.patch index 04ef222..b3d0e0e 100644 --- a/patches/server/0033-Patch-large-selector-distance-crash.patch +++ b/patches/server/0029-Patch-large-selector-distance-crash.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Patch large selector distance crash diff --git a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java -index d87ffb5ed4550757016c2fabaa2845a6aaac74d7..7e8cf65ac53f595292d161da0735bf97081e832a 100644 +index f62640152027b874d4266d868574af062bd684d7..f94385837d5ed1ef52458b73410df5fd186d66e2 100644 --- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java +++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java @@ -123,11 +123,11 @@ public interface MinMaxBounds { - - public static record Doubles(Optional min, Optional max, Optional minSq, Optional maxSq) implements MinMaxBounds { + public static record Doubles(@Override Optional min, @Override Optional max, Optional minSq, Optional maxSq) + implements MinMaxBounds { public static final MinMaxBounds.Doubles ANY = new MinMaxBounds.Doubles(Optional.empty(), Optional.empty()); - public static final Codec CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new); + public static final Codec CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new); // Scissors - compile fixes @@ -23,15 +23,15 @@ index d87ffb5ed4550757016c2fabaa2845a6aaac74d7..7e8cf65ac53f595292d161da0735bf97 private static MinMaxBounds.Doubles create(StringReader reader, Optional min, Optional max) throws CommandSyntaxException { if (min.isPresent() && max.isPresent() && min.get() > max.get()) { -@@ -188,7 +188,7 @@ public interface MinMaxBounds { - - public static record Ints(Optional min, Optional max, Optional minSq, Optional maxSq) implements MinMaxBounds { +@@ -179,7 +179,7 @@ public interface MinMaxBounds { + public static record Ints(@Override Optional min, @Override Optional max, Optional minSq, Optional maxSq) + implements MinMaxBounds { public static final MinMaxBounds.Ints ANY = new MinMaxBounds.Ints(Optional.empty(), Optional.empty()); - public static final Codec CODEC = MinMaxBounds.createCodec(Codec.INT, MinMaxBounds.Ints::new); + public static final Codec CODEC = MinMaxBounds.createCodec(Codec.INT, MinMaxBounds.Ints::new); // Scissors - compile fixes private Ints(Optional min, Optional max) { - this(min, max, min.map((i) -> { + this(min, max, min.map(i -> i.longValue() * i.longValue()), squareOpt(max)); diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java index 676a1499747b071515479130875157263d3a8352..6a65850101b8ea348a4bfeaeca805a39987b06fc 100644 --- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java diff --git a/patches/server/0034-Patch-invalid-entity-rotation-log-spam.patch b/patches/server/0030-Patch-invalid-entity-rotation-log-spam.patch similarity index 83% rename from patches/server/0034-Patch-invalid-entity-rotation-log-spam.patch rename to patches/server/0030-Patch-invalid-entity-rotation-log-spam.patch index 217e16d..033bfa5 100644 --- a/patches/server/0034-Patch-invalid-entity-rotation-log-spam.patch +++ b/patches/server/0030-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 79ef94350828bcf780ee65d9de7006730214a2c8..ed116878cf8525f4ab5b6656d6e40e8504a4f42b 100644 +index 637478fd8a284e6833cf8f5fa17ccf9d73d1dd3f..aec4991e8bd75c0020029008951e4cc2a83ed2b2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4751,7 +4751,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4755,7 +4755,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void setXRot(float pitch) { if (!Float.isFinite(pitch)) { diff --git a/patches/server/0035-Limit-sculk-catalyst-cursor-positions.patch b/patches/server/0031-Limit-sculk-catalyst-cursor-positions.patch similarity index 100% rename from patches/server/0035-Limit-sculk-catalyst-cursor-positions.patch rename to patches/server/0031-Limit-sculk-catalyst-cursor-positions.patch diff --git a/patches/server/0032-Add-configuration-option-to-disable-chat-signatures.patch b/patches/server/0032-Add-configuration-option-to-disable-chat-signatures.patch deleted file mode 100644 index 56788f0..0000000 --- a/patches/server/0032-Add-configuration-option-to-disable-chat-signatures.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Allink -Date: Sun, 10 Dec 2023 18:48:55 -0600 -Subject: [PATCH] Add configuration option to disable chat signatures - - -diff --git a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java -index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..939f4a0639c847b94cfc9acf1409a7a3fc5ae58f 100644 ---- a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java -+++ b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java -@@ -1,5 +1,6 @@ - package net.minecraft.network.chat; - -+import me.totalfreedom.scissors.ScissorsConfig; - import net.minecraft.server.level.ServerPlayer; - - public interface OutgoingChatMessage { -@@ -44,10 +45,22 @@ public interface OutgoingChatMessage { - // Paper end - PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled); - playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper -- if (!playerChatMessage.isFullyFiltered()) { -+ // Sccissors start -+ if (!playerChatMessage.isFullyFiltered() && ScissorsConfig.chatSignaturesEnabled) { - sender.connection.sendPlayerChatMessage(playerChatMessage, params); -+ return; - } - -+ sender.connection.sendPlayerChatMessage(new PlayerChatMessage( -+ SignedMessageLink.unsigned(playerChatMessage.sender()), -+ null, -+ SignedMessageBody.unsigned(playerChatMessage.signedContent()), -+ unsigned, -+ playerChatMessage.filterMask(), -+ playerChatMessage.result() -+ ), params); -+ // Scissors end -+ - } - } - } -diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java -index ba12919c3f9aec34a9e64993b143ae92be5eb172..bdfa4a7f5b50e80195e79a6dd1204cb73bebd79e 100644 ---- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java -+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java -@@ -5,6 +5,8 @@ import java.time.Instant; - import java.util.UUID; - import java.util.function.BooleanSupplier; - import javax.annotation.Nullable; -+ -+import me.totalfreedom.scissors.ScissorsConfig; - import net.minecraft.util.SignatureUpdater; - import net.minecraft.util.SignatureValidator; - import net.minecraft.util.Signer; -@@ -46,7 +48,7 @@ public class SignedMessageChain { - if (!playerChatMessage.verify(signatureValidator)) { - throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event causes - } else { -- if (playerChatMessage.hasExpiredServer(Instant.now())) { -+ if (playerChatMessage.hasExpiredServer(Instant.now()) && ScissorsConfig.chatSignaturesEnabled) { // Scissors - LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content()); - } - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 23f4fc3cc157830da18bf5905eb51f2ae2b452bd..29d230487b42150b8790685653e1ed24d435b417 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 @@ - package net.minecraft.server.network; - -+import me.totalfreedom.scissors.ScissorsConfig; - import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors - import com.google.common.collect.Lists; - import com.google.common.primitives.Floats; -@@ -2243,7 +2244,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { - ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString()); -- if (exception.shouldDisconnect()) { -+ if (exception.shouldDisconnect() && ScissorsConfig.chatSignaturesEnabled) { // Scissors - Do not kick when chat signatures are disabled - this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes - } else { - this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); -@@ -2291,6 +2292,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - Optional optional = this.lastSeenMessages.applyUpdate(acknowledgment); - - if (optional.isEmpty()) { -+ if (!ScissorsConfig.chatSignaturesEnabled) return optional; // Scissors - 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 - } -@@ -2489,6 +2491,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - synchronized (this.lastSeenMessages) { - if (!this.lastSeenMessages.applyOffset(packet.offset())) { -+ if (!ScissorsConfig.chatSignaturesEnabled) return; // Scissors - 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 - } -@@ -3460,6 +3463,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - @Override - public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); -+ if (!ScissorsConfig.chatSignaturesEnabled) return; // Scissors - RemoteChatSession.Data remotechatsession_a = packet.chatSession(); - ProfilePublicKey.Data profilepublickey_a = this.chatSession != null ? this.chatSession.profilePublicKey().data() : null; - ProfilePublicKey.Data profilepublickey_a1 = remotechatsession_a.profilePublicKey(); diff --git a/patches/server/0036-Limit-map-decorations.patch b/patches/server/0032-Limit-map-decorations.patch similarity index 90% rename from patches/server/0036-Limit-map-decorations.patch rename to patches/server/0032-Limit-map-decorations.patch index 18ab119..5d0db53 100644 --- a/patches/server/0036-Limit-map-decorations.patch +++ b/patches/server/0032-Limit-map-decorations.patch @@ -5,19 +5,19 @@ Subject: [PATCH] Limit map decorations diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java -index 17343d515044f3678b4edf070ee7ca244adc4228..8ade519114bec879bed8e8e23707a85327da131b 100644 +index 02e3d1c9c18952ba53507f7b6887fd3c81af33a9..61573844b236838fd219526ea35df8c7b0c94026 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java -@@ -65,7 +65,8 @@ public class ClientboundMapItemDataPacket implements Packet -Date: Mon, 11 Dec 2023 12:27:44 -0600 -Subject: [PATCH] Implement command block events - - -diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundSetCommandMinecartPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundSetCommandMinecartPacket.java -index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400deb533d2 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ServerboundSetCommandMinecartPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundSetCommandMinecartPacket.java -@@ -9,7 +9,7 @@ import net.minecraft.world.level.BaseCommandBlock; - import net.minecraft.world.level.Level; - - public class ServerboundSetCommandMinecartPacket implements Packet { -- private final int entity; -+ public final int entity; // Scissors - private -> public - private final String command; - 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 f2c3b81779bbd2c52068750e65e66e1ca6c4d492..b69f7c74fe4e2ec6280ebee27f8b8fd0ec8ac361 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 @@ - package net.minecraft.server.network; - - import me.totalfreedom.scissors.ScissorsConfig; -+import me.totalfreedom.scissors.event.block.CommandBlockPlayerEditEvent; -+import me.totalfreedom.scissors.event.block.CommandMinecartPlayerEditEvent; - import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors - import com.google.common.collect.Lists; - import com.google.common.primitives.Floats; -@@ -155,6 +157,7 @@ import net.minecraft.world.entity.player.Inventory; - import net.minecraft.world.entity.player.ProfilePublicKey; - import net.minecraft.world.entity.projectile.AbstractArrow; - import net.minecraft.world.entity.vehicle.Boat; -+import net.minecraft.world.entity.vehicle.MinecartCommandBlock; - import net.minecraft.world.inventory.AbstractContainerMenu; - import net.minecraft.world.inventory.AnvilMenu; - import net.minecraft.world.inventory.BeaconMenu; -@@ -189,6 +192,8 @@ import net.minecraft.world.phys.Vec3; - import net.minecraft.world.phys.shapes.BooleanOp; - import net.minecraft.world.phys.shapes.Shapes; - import net.minecraft.world.phys.shapes.VoxelShape; -+import org.bukkit.craftbukkit.block.CraftCommandBlock; -+import org.bukkit.craftbukkit.entity.CraftMinecartCommand; - import org.slf4j.Logger; - - // CraftBukkit start -@@ -905,6 +910,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity); - } - -+ // Scissors start -+ CommandBlockPlayerEditEvent event = new CommandBlockPlayerEditEvent(this.getCraftPlayer(), commandblocklistenerabstract.getCommand(), s, new CraftCommandBlock(this.player.level().getWorld(), tileentitycommand)); -+ -+ if (!event.callEvent()) { -+ return; -+ } -+ -+ s = event.getNewCommand(); -+ // Scissors end -+ - commandblocklistenerabstract.setCommand(s); - commandblocklistenerabstract.setTrackOutput(flag); - if (!flag) { -@@ -936,7 +951,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level()); - - if (commandblocklistenerabstract != null) { -- commandblocklistenerabstract.setCommand(packet.getCommand()); -+ // Scissors start - Implement command block events -+ String command = packet.getCommand(); -+ CommandMinecartPlayerEditEvent event = new CommandMinecartPlayerEditEvent(this.getCraftPlayer(), commandblocklistenerabstract.getCommand(), command, new CraftMinecartCommand(this.cserver, (MinecartCommandBlock) this.player.level().getEntity(packet.entity))); -+ -+ if (!event.callEvent()) { -+ return; -+ } -+ -+ command = event.getNewCommand(); -+ commandblocklistenerabstract.setCommand(command); -+ -+ // Scissors end - commandblocklistenerabstract.setTrackOutput(packet.isTrackOutput()); - if (!packet.isTrackOutput()) { - commandblocklistenerabstract.setLastOutput((Component) null); diff --git a/patches/server/0045-Limit-save-data-for-Bees-and-Vexes.patch b/patches/server/0039-Limit-save-data-for-Bees-and-Vexes.patch similarity index 100% rename from patches/server/0045-Limit-save-data-for-Bees-and-Vexes.patch rename to patches/server/0039-Limit-save-data-for-Bees-and-Vexes.patch diff --git a/patches/server/0040-Add-depth-limit-to-SNBT.patch b/patches/server/0040-Add-depth-limit-to-SNBT.patch deleted file mode 100644 index 7f463a7..0000000 --- a/patches/server/0040-Add-depth-limit-to-SNBT.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Allink -Date: Fri, 2 Jun 2023 22:13:54 +0100 -Subject: [PATCH] Add depth limit to SNBT - - -diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java -index 94cb73e7f60171aa57bd1dbe7e91ef4db94e70b7..9ed1c477620b41317c4bf2b14ebc672c2fdd4656 100644 ---- a/src/main/java/net/minecraft/nbt/TagParser.java -+++ b/src/main/java/net/minecraft/nbt/TagParser.java -@@ -182,9 +182,56 @@ public class TagParser { - - this.expect('}'); - this.depth--; // Paper -- return compoundTag; -+ return exceedsDepthLimit(compoundTag) ? new CompoundTag() : compoundTag; // Scissors - Add depth limit to SNBT - } - -+ // Scissors start - Add depth limit to SNBT -+ private boolean exceedsDepthLimit(Tag tag) { -+ return this.exceedsDepthLimit(0, tag); -+ } -+ -+ private boolean exceedsDepthLimit(long depth, Tag tag) -+ { -+ if (depth > 256) -+ { -+ return true; -+ } -+ -+ if (tag instanceof ListTag listTag) -+ { -+ for (Tag childTag : listTag) -+ { -+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag); -+ -+ if (returnValue) -+ { -+ return true; -+ } -+ } -+ } else if (tag instanceof CompoundTag compoundTag) -+ { -+ for (String key: compoundTag.getAllKeys()) -+ { -+ Tag childTag = compoundTag.get(key); -+ -+ if (childTag == null) -+ { -+ continue; -+ } -+ -+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag); -+ -+ if (returnValue) -+ { -+ return true; -+ } -+ } -+ } -+ -+ return false; -+ } -+ // Scissors end -+ - private Tag readListTag() throws CommandSyntaxException { - this.expect('['); - this.reader.skipWhitespace(); -@@ -218,7 +265,7 @@ public class TagParser { - - this.expect(']'); - this.depth--; // Paper -- return listTag; -+ return exceedsDepthLimit(listTag) ? new ListTag() : listTag; // Scissors - Add depth limit to SNBT - } - } - -@@ -243,7 +290,7 @@ public class TagParser { - } - - private List readArray(TagType arrayTypeReader, TagType typeReader) throws CommandSyntaxException { -- List list = Lists.newArrayList(); -+ List list = Lists.newArrayList(); // Scissors - List -> List - - while(true) { - if (this.reader.peek() != ']') { -@@ -256,11 +303,11 @@ public class TagParser { - } - - if (typeReader == ByteTag.TYPE) { -- list.add((T)((NumericTag)tag).getAsNumber()); // Paper - decompile fix -+ list.add(((NumericTag)tag).getAsNumber()); // Scissors - Remove (T) cast - } else if (typeReader == LongTag.TYPE) { -- list.add((T)((NumericTag)tag).getAsNumber()); // Paper - decompile fix -+ list.add(((NumericTag)tag).getAsNumber()); // Scissors - Remove (T) cast - } else { -- list.add((T)((NumericTag)tag).getAsNumber()); // Paper - decompile fix -+ list.add(((NumericTag)tag).getAsNumber()); // Scissors - Remove (T) cast - } - - if (this.hasElementSeparator()) { -@@ -272,7 +319,7 @@ public class TagParser { - } - - this.expect(']'); -- return list; -+ return (List) list; // Scissors - Cast to List - } - } - diff --git a/patches/server/0046-Mute-invalid-attributes.patch b/patches/server/0040-Mute-invalid-attributes.patch similarity index 64% rename from patches/server/0046-Mute-invalid-attributes.patch rename to patches/server/0040-Mute-invalid-attributes.patch index adb73e5..4b49c30 100644 --- a/patches/server/0046-Mute-invalid-attributes.patch +++ b/patches/server/0040-Mute-invalid-attributes.patch @@ -5,28 +5,31 @@ Subject: [PATCH] Mute invalid attributes diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java -index 897d7632ecfea40890433474870dd7a5e534d8ab..7c522cf74bd86a73a08ebd1b2de69b5b9da6559b 100644 +index b99a080ab27e24d8131fda931ca70d6d271bb01c..f88b31d9bfc8b332230fa318ba2c1de14d5cc9be 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java -@@ -147,7 +147,7 @@ public class AttributeMap { +@@ -135,7 +135,10 @@ public class AttributeMap { + if (attributeInstance != null) { + attributeInstance.load(compoundTag); } - - }, () -> { -- LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string); +- }, () -> LOGGER.warn("Ignoring unknown attribute '{}'", string)); ++ ++ }, () -> { + // LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string); // Scissors - Mute invalid attributes - }); ++ }); } + } diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java -index 1b0db545f93b51368c2d384dd1ba45b93d9eff87..5c3633aa6a256a197502c8139cbf61c2f493bda7 100644 +index a38e91552ead256bd8dd3b74794d742555681c2d..116af10e6e2467a3e3b0095c4968a79ebb4a19d6 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java -@@ -86,7 +86,7 @@ public class AttributeModifier { +@@ -90,7 +90,7 @@ public class AttributeModifier { AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation")); return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation); } catch (Exception var3) { -- LOGGER.warn("Unable to create attribute: {}", (Object)var3.getMessage()); -+ // LOGGER.warn("Unable to create attribute: {}", (Object)var3.getMessage()); // Scissors - Mute invalid attributes +- LOGGER.warn("Unable to create attribute: {}", var3.getMessage()); ++ // LOGGER.warn("Unable to create attribute: {}", var3.getMessage()); // Scissors - Mute invalid attributes return null; } } diff --git a/patches/server/0047-Mute-invalid-Enderdragon-phases.patch b/patches/server/0041-Mute-invalid-Enderdragon-phases.patch similarity index 89% rename from patches/server/0047-Mute-invalid-Enderdragon-phases.patch rename to patches/server/0041-Mute-invalid-Enderdragon-phases.patch index 34d06e8..f407865 100644 --- a/patches/server/0047-Mute-invalid-Enderdragon-phases.patch +++ b/patches/server/0041-Mute-invalid-Enderdragon-phases.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Mute invalid Enderdragon phases diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java -index bca131e9c428e2cb073ae2ef517dda12f73a5dcd..b9d603c82b12299e94c31928b36c9517834cff62 100644 +index 1b1a210a86121049e507a497649727a99452c0a2..a8bcadbf64d5034b172427e16b1468b4c91c4518 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java @@ -20,7 +20,7 @@ public class DragonChargePlayerPhase extends AbstractDragonPhaseInstance { @@ -18,10 +18,10 @@ index bca131e9c428e2cb073ae2ef517dda12f73a5dcd..b9d603c82b12299e94c31928b36c9517 } else if (this.timeSinceCharge > 0 && this.timeSinceCharge++ >= 10) { this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN); diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java -index 9bf04f18d37356cdef1ef3a7f1e38a1801ad5713..7a8fd11245c801f1b869357c7244dc6dff8dd5de 100644 +index 13f60a16f07c50a278b158d64180009020a4dca6..289361cbaad2ca6392ee66627becb8f973bb1e54 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java -@@ -32,7 +32,7 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance { +@@ -31,7 +31,7 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance { @Override public void doServerTick() { if (this.attackTarget == null) { diff --git a/patches/server/0048-Add-length-limit-to-note-block-sound.patch b/patches/server/0042-Add-length-limit-to-note-block-sound.patch similarity index 100% rename from patches/server/0048-Add-length-limit-to-note-block-sound.patch rename to patches/server/0042-Add-length-limit-to-note-block-sound.patch diff --git a/patches/server/0049-Change-version-fetcher-to-AMG.patch b/patches/server/0043-Change-version-fetcher-to-AMG.patch similarity index 98% rename from patches/server/0049-Change-version-fetcher-to-AMG.patch rename to patches/server/0043-Change-version-fetcher-to-AMG.patch index 1206199..ed9fe29 100644 --- a/patches/server/0049-Change-version-fetcher-to-AMG.patch +++ b/patches/server/0043-Change-version-fetcher-to-AMG.patch @@ -75,7 +75,7 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..48dd50d0e443a59835e92616874c9856 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 058819b39f0e2ba248e0a0c834f462a89263442b..f5363e289cdb0b0d71ff6d902acf5ee603ddcf98 100644 +index c0538206a53f0e6d9b54bddde0259b89ac73d675..5ebb80ed81d9bbd4c69a14ccd0be6c67de2fcf0d 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -315,7 +315,7 @@ public class Main { diff --git a/patches/server/0050-Add-depth-limit-to-Component-deserialization.patch b/patches/server/0044-Add-depth-limit-to-Component-deserialization.patch similarity index 92% rename from patches/server/0050-Add-depth-limit-to-Component-deserialization.patch rename to patches/server/0044-Add-depth-limit-to-Component-deserialization.patch index 9f84c4b..aab7338 100644 --- a/patches/server/0050-Add-depth-limit-to-Component-deserialization.patch +++ b/patches/server/0044-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..df3c03aeaee5c12c5d57584535c9c7aa01be7dd3 100644 +index d3a80d0a23be762c05931ae8001d98e43cab2b4a..e747eddff10e1be2b503cbbf503a21e1de4569ba 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; @@ -28,15 +28,17 @@ index ba13650b52e39c9cc5cfa421f7720c7d4ba75678..df3c03aeaee5c12c5d57584535c9c7aa import java.io.StringReader; import java.lang.reflect.Type; import java.util.ArrayList; -@@ -24,6 +27,7 @@ import java.util.Optional; +@@ -23,6 +26,9 @@ import java.util.List; + import java.util.Optional; import java.util.UUID; import javax.annotation.Nullable; - ++ +import me.totalfreedom.scissors.ScissorsConfig; // Scissors - import net.minecraft.ChatFormatting; ++import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.network.chat.contents.DataSource; -@@ -35,8 +39,10 @@ import net.minecraft.network.chat.contents.SelectorContents; + import net.minecraft.network.chat.contents.KeybindContents; +@@ -33,8 +39,10 @@ import net.minecraft.network.chat.contents.SelectorContents; import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.FormattedCharSequence; @@ -47,7 +49,7 @@ index ba13650b52e39c9cc5cfa421f7720c7d4ba75678..df3c03aeaee5c12c5d57584535c9c7aa import java.util.stream.Stream; // CraftBukkit end -@@ -286,10 +292,65 @@ public interface Component extends Message, FormattedText, Iterable { +@@ -284,10 +292,65 @@ public interface Component extends Message, FormattedText, Iterable { public static class Serializer { private static final Gson GSON = (new GsonBuilder()).disableHtmlEscaping().create(); diff --git a/patches/server/0051-Add-depth-limit-to-updateCustomBlockEntityTag.patch b/patches/server/0045-Add-depth-limit-to-updateCustomBlockEntityTag.patch similarity index 100% rename from patches/server/0051-Add-depth-limit-to-updateCustomBlockEntityTag.patch rename to patches/server/0045-Add-depth-limit-to-updateCustomBlockEntityTag.patch