Skip to content

Commit c9573a1

Browse files
committed
Move data handling 1.21.5 text component rewriting to the right place
Fixes #997
1 parent def9df8 commit c9573a1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_5to1_21_4/rewriter/ComponentRewriter1_21_5.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.viaversion.viaversion.util.TagUtil;
3333
import java.util.HashSet;
3434
import java.util.Set;
35+
import org.checkerframework.checker.nullness.qual.Nullable;
3536

3637
import static com.viaversion.viaversion.util.TagUtil.getNamespacedCompoundTag;
3738
import static com.viaversion.viaversion.util.TagUtil.getNamespacedCompoundTagList;
@@ -102,13 +103,19 @@ private void updateShowItemHover(final UserConnection connection, final Compound
102103

103104
final CompoundTag componentsTag = hoverEventTag.getCompoundTag("components");
104105
handleShowItem(connection, contents, componentsTag);
106+
if (componentsTag != null) {
107+
hoverEventTag.remove("components");
108+
contents.put("components", componentsTag);
109+
}
110+
}
111+
112+
@Override
113+
protected void handleShowItem(final UserConnection connection, final CompoundTag itemTag, @Nullable final CompoundTag componentsTag) {
114+
super.handleShowItem(connection, itemTag, componentsTag);
105115
if (componentsTag == null) {
106116
return;
107117
}
108118

109-
hoverEventTag.remove("components");
110-
contents.put("components", componentsTag);
111-
112119
final CompoundTag useRemainder = TagUtil.getNamespacedCompoundTag(componentsTag, "use_remainder");
113120
if (useRemainder != null) {
114121
handleShowItem(connection, useRemainder);

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ metadata.format.version = "1.1"
33
[versions]
44

55
# ViaVersion
6-
viaver = "5.3.2-SNAPSHOT"
6+
viaver = "5.3.3-SNAPSHOT"
77

88
# Common provided
99
netty = "4.0.20.Final"

0 commit comments

Comments
 (0)