Use boolean + string

This commit is contained in:
creeper123123321 2019-02-15 18:24:42 -02:00
parent 6e5f9e0741
commit 829857be7c
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

View File

@ -114,14 +114,18 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
} }
packetWrapper.passthrough(Type.VAR_INT); packetWrapper.passthrough(Type.VAR_INT);
packetWrapper.passthrough(Type.VAR_INT); packetWrapper.passthrough(Type.VAR_INT);
packetWrapper.passthrough(Type.OPTIONAL_CHAT); if (packetWrapper.passthrough(Type.BOOLEAN)) {
packetWrapper.passthrough(Type.STRING);
}
} }
} else if (action == 1) { // Update Game Mode } else if (action == 1) { // Update Game Mode
packetWrapper.passthrough(Type.VAR_INT); packetWrapper.passthrough(Type.VAR_INT);
} else if (action == 2) { // Update Ping } else if (action == 2) { // Update Ping
packetWrapper.passthrough(Type.VAR_INT); packetWrapper.passthrough(Type.VAR_INT);
} else if (action == 3) { // Update Display Name } else if (action == 3) { // Update Display Name
packetWrapper.passthrough(Type.OPTIONAL_CHAT); if (packetWrapper.passthrough(Type.BOOLEAN)) {
packetWrapper.passthrough(Type.STRING);
}
} else if (action == 4) { // Remove Player } else if (action == 4) { // Remove Player
storage.usernames.remove(uuid); storage.usernames.remove(uuid);
} }