3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-24 23:30:17 +01:00

Read correct method type in update score

Fixes #650
Dieser Commit ist enthalten in:
Nassim Jahnke 2023-12-13 12:04:43 +01:00
Ursprung e020dd69ef
Commit a390990178
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -91,14 +91,14 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol<ClientboundP
registerClientbound(ClientboundPackets1_20_3.RESET_SCORE, ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> { registerClientbound(ClientboundPackets1_20_3.RESET_SCORE, ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> {
wrapper.passthrough(Type.STRING); // Owner wrapper.passthrough(Type.STRING); // Owner
wrapper.write(Type.BYTE, (byte) 1); // Reset score wrapper.write(Type.VAR_INT, 1); // Reset score
final String objectiveName = wrapper.read(Type.OPTIONAL_STRING); final String objectiveName = wrapper.read(Type.OPTIONAL_STRING);
wrapper.write(Type.STRING, objectiveName != null ? objectiveName : ""); // Objective name wrapper.write(Type.STRING, objectiveName != null ? objectiveName : ""); // Objective name
}); });
registerClientbound(ClientboundPackets1_20_3.UPDATE_SCORE, wrapper -> { registerClientbound(ClientboundPackets1_20_3.UPDATE_SCORE, wrapper -> {
wrapper.passthrough(Type.STRING); // Owner wrapper.passthrough(Type.STRING); // Owner
wrapper.write(Type.BYTE, (byte) 0); // Change score wrapper.write(Type.VAR_INT, 0); // Change score
wrapper.passthrough(Type.STRING); // Objective name wrapper.passthrough(Type.STRING); // Objective name
wrapper.passthrough(Type.VAR_INT); // Score wrapper.passthrough(Type.VAR_INT); // Score