From f673d548420a66f0174fbcda9c29934304802d5a Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 26 Apr 2024 15:25:20 -0700 Subject: [PATCH] fix exact choice recipes --- patches/server/Adventure.patch | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 1908259a8d..a303b09b6d 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -547,6 +547,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public Component adventure$component() { + return this.adventure; + } ++ ++ @Override ++ public int hashCode() { ++ return this.deepConverted().hashCode(); ++ } ++ ++ @Override ++ public boolean equals(final Object obj) { ++ return this.deepConverted().equals(obj); ++ } +} diff --git a/src/main/java/io/papermc/paper/adventure/BossBarImplementationImpl.java b/src/main/java/io/papermc/paper/adventure/BossBarImplementationImpl.java new file mode 100644 @@ -2408,6 +2418,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static final Codec CODEC = ExtraCodecs.BASE64_STRING.xmap(MessageSignature::new, MessageSignature::bytes); public static final int BYTES = 256; +diff --git a/src/main/java/net/minecraft/network/chat/MutableComponent.java b/src/main/java/net/minecraft/network/chat/MutableComponent.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/network/chat/MutableComponent.java ++++ b/src/main/java/net/minecraft/network/chat/MutableComponent.java +@@ -0,0 +0,0 @@ public class MutableComponent implements Component { + + @Override + public boolean equals(Object object) { ++ // Paper start - make AdventureComponent equivalent ++ if (object instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) { ++ object = adventureComponent.deepConverted(); ++ } ++ // Paper end - make AdventureComponent equivalent + return this == object + || object instanceof MutableComponent mutableComponent + && this.contents.equals(mutableComponent.contents) diff --git a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java