Skip to content

Commit

Permalink
Read correct method type in update score
Browse files Browse the repository at this point in the history
Fixes #650
  • Loading branch information
kennytv committed Dec 13, 2023
1 parent e020dd6 commit a390990
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ public void handleArgument(final PacketWrapper wrapper, final String argumentTyp

registerClientbound(ClientboundPackets1_20_3.RESET_SCORE, ClientboundPackets1_20_2.UPDATE_SCORE, wrapper -> {
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);
wrapper.write(Type.STRING, objectiveName != null ? objectiveName : ""); // Objective name
});
registerClientbound(ClientboundPackets1_20_3.UPDATE_SCORE, wrapper -> {
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.VAR_INT); // Score

Expand Down

0 comments on commit a390990

Please sign in to comment.