3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +01:00

Fix reset score writing

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-11-26 15:31:33 +01:00
Ursprung 28f661f270
Commit 4add75cda7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

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