Fix reset score writing

This commit is contained in:
Nassim Jahnke 2023-11-26 15:31:33 +01:00
parent 28f661f270
commit 4add75cda7
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
1 changed files with 3 additions and 1 deletions

View File

@ -112,13 +112,15 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
wrapper.passthrough(Type.STRING); // Owner
final byte action = wrapper.read(Type.BYTE);
wrapper.passthrough(Type.STRING); // Objective name
final String objectiveName = wrapper.read(Type.STRING);
if (action == 1) { // Reset score
wrapper.write(Type.OPTIONAL_STRING, objectiveName.isEmpty() ? null : objectiveName);
wrapper.setPacketType(ClientboundPackets1_20_3.RESET_SCORE);
return;
}
wrapper.write(Type.STRING, objectiveName != null ? objectiveName : "");
wrapper.passthrough(Type.VAR_INT); // Score
// Null display and number format