diff --git a/gradle.properties b/gradle.properties index b87dea9..b90e60a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ authors=Sisby folk contributors=Ampflower, falkreon, jaskarth, Garden System license=LGPL-3.0-or-later # Mod Version -baseVersion=0.6.24 +baseVersion=0.6.25 # Branch Metadata branch=1.20 tagBranch=1.20 diff --git a/src/main/java/folk/sisby/surveyor/util/TextUtil.java b/src/main/java/folk/sisby/surveyor/util/TextUtil.java index b9a281c..759086f 100644 --- a/src/main/java/folk/sisby/surveyor/util/TextUtil.java +++ b/src/main/java/folk/sisby/surveyor/util/TextUtil.java @@ -16,9 +16,13 @@ public class TextUtil { public static Text stripInteraction(Text text) { - NbtCompound nbt = (NbtCompound) Codecs.TEXT.encodeStart(NbtOps.INSTANCE, text).getOrThrow(false, null); - NbtUtil.removeRecursive(nbt, List.of("hoverEvent", "clickEvent", "insertion")); - return Codecs.TEXT.decode(NbtOps.INSTANCE, nbt).getOrThrow(false, null).getFirst(); + try { + NbtCompound nbt = (NbtCompound) Codecs.TEXT.encodeStart(NbtOps.INSTANCE, text).getOrThrow(true, null); + NbtUtil.removeRecursive(nbt, List.of("hoverEvent", "clickEvent", "insertion")); + return Codecs.TEXT.decode(NbtOps.INSTANCE, nbt).getOrThrow(true, null).getFirst(); + } catch (Exception e) { + return Text.literal(text.getString()); + } } public static MutableText highlightStrings(Collection list, Function highlighter) {