Fix tab complete tooltip reading in old versions

Fixes #648
This commit is contained in:
Nassim Jahnke 2023-12-11 11:27:52 +01:00
parent b09950dc64
commit e020dd69ef
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 2 additions and 8 deletions

View File

@ -319,10 +319,7 @@ public class PlayerPacket1_13 extends RewriterBase<Protocol1_12_2To1_13> {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
String match = wrapper.read(Type.STRING); String match = wrapper.read(Type.STRING);
wrapper.write(Type.STRING, (start == 0 && !storage.isLastAssumeCommand() ? "/" : "") + match); wrapper.write(Type.STRING, (start == 0 && !storage.isLastAssumeCommand() ? "/" : "") + match);
// Ignore tooltip wrapper.read(Type.OPTIONAL_COMPONENT); // Remove tooltip
if (wrapper.read(Type.BOOLEAN)) {
wrapper.read(Type.STRING);
}
} }
}); });

View File

@ -136,10 +136,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
int count = wrapper.get(Type.VAR_INT, 3); int count = wrapper.get(Type.VAR_INT, 3);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.STRING);
boolean hasTooltip = wrapper.passthrough(Type.BOOLEAN); wrapper.passthrough(Type.OPTIONAL_COMPONENT); // Tooltip
if (hasTooltip) {
wrapper.passthrough(Type.STRING); // JSON Tooltip
}
} }
}); });
} }