mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2025-03-14 07:00:03 -04:00
Fix certain serializations of ClientboundPlayerInfoUpdatePacket
This commit is contained in:
parent
4b3e86a0b1
commit
79efb7d857
1 changed files with 9 additions and 5 deletions
|
@ -20,7 +20,6 @@ import java.security.spec.X509EncodedKeySpec;
|
|||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Data
|
||||
@With
|
||||
|
@ -102,13 +101,18 @@ public class ClientboundPlayerInfoUpdatePacket implements MinecraftPacket {
|
|||
helper.writeEnumSet(out, this.actions, PlayerListEntryAction.VALUES);
|
||||
helper.writeVarInt(out, this.entries.length);
|
||||
for (PlayerListEntry entry : this.entries) {
|
||||
helper.writeUUID(out, entry.getProfile().getId());
|
||||
helper.writeUUID(out, entry.getProfileId());
|
||||
for (PlayerListEntryAction action : this.actions) {
|
||||
switch (action) {
|
||||
case ADD_PLAYER:
|
||||
helper.writeString(out, entry.getProfile().getName());
|
||||
helper.writeVarInt(out, entry.getProfile().getProperties().size());
|
||||
for (GameProfile.Property property : entry.getProfile().getProperties()) {
|
||||
GameProfile profile = entry.getProfile();
|
||||
if (profile == null) {
|
||||
throw new IllegalArgumentException("Cannot ADD " + entry.getProfileId() + " without a profile.");
|
||||
}
|
||||
|
||||
helper.writeString(out, profile.getName());
|
||||
helper.writeVarInt(out, profile.getProperties().size());
|
||||
for (GameProfile.Property property : profile.getProperties()) {
|
||||
helper.writeProperty(out, property);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue