Skip to content

Commit fccea9b

Browse files
Throw out object components in 1.21.9->1.21.7 (#1108)
1 parent 917427c commit fccea9b

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_9to1_21_7/rewriter/ComponentRewriter1_21_9.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ public ComponentRewriter1_21_9(final BackwardsProtocol<ClientboundPacket1_21_9,
3030
super(protocol);
3131
}
3232

33+
@Override
34+
protected void processCompoundTag(final UserConnection connection, final CompoundTag tag) {
35+
super.processCompoundTag(connection, tag);
36+
37+
// Throw out the new object type and its properties
38+
final String type = tag.getString("type");
39+
if ("object".equals(type)) {
40+
tag.putString("text", "");
41+
tag.remove("type");
42+
}
43+
if (tag.remove("sprite") != null) {
44+
tag.putString("text", "");
45+
}
46+
if (tag.remove("player") != null) {
47+
tag.putString("text", "");
48+
}
49+
tag.remove("atlas");
50+
tag.remove("font");
51+
}
52+
3353
@Override
3454
protected void handleShowItem(final UserConnection connection, final CompoundTag itemTag, final CompoundTag componentsTag) {
3555
super.handleShowItem(connection, itemTag, componentsTag);

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
projectVersion=5.5.0
1+
projectVersion=5.5.1-SNAPSHOT
22

33
# Smile emoji (note that modrinth may not have added the version on release yet)
44
mcVersions=1.21.9, 1.21.8, 1.21.7, 1.21.6, 1.21.5, 1.21.4, 1.21.3, 1.21.2, 1.21.1, 1.21, 1.20.6, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10

0 commit comments

Comments
 (0)