Custom Teams (#1731)

* Add support for creating and deleting custom teams.

* Add support for creating and deleting custom teams.

* Move some logic to TeamInfo::toProto
This commit is contained in:
GanyusLeftHorn
2022-09-01 02:21:47 +02:00
committed by GitHub
Unverified
parent 4f015c1077
commit 712d17631f
17 changed files with 3678 additions and 125 deletions
@@ -25,17 +25,16 @@ public class PacketAvatarDataNotify extends BasePacket {
proto.addAvatarList(avatar.toProto());
}
// Add the id list for custom teams.
for (int id : player.getTeamManager().getTeams().keySet()) {
if (id > 4) {
proto.addCustomTeamIds(id);
}
}
for (Entry<Integer, TeamInfo> entry : player.getTeamManager().getTeams().entrySet()) {
TeamInfo teamInfo = entry.getValue();
AvatarTeam.Builder avatarTeam = AvatarTeam.newBuilder()
.setTeamName(teamInfo.getName());
for (int i = 0; i < teamInfo.getAvatars().size(); i++) {
Avatar avatar = player.getAvatars().getAvatarById(teamInfo.getAvatars().get(i));
avatarTeam.addAvatarGuidList(avatar.getGuid());
}
proto.putAvatarTeamMap(entry.getKey(), avatarTeam.build());
proto.putAvatarTeamMap(entry.getKey(), teamInfo.toProto(player));
}
// Set main character