mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-16 05:12:31 +08:00
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:
committed by
GitHub
Unverified
parent
4f015c1077
commit
712d17631f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user