mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-18 01:46:44 +01:00
fix join command and remove command bug and update docs (#904)
* feat:new command "join" and "remove" to force join or remove avatar in your current team * fix:change MaxAvatarsInTeam from 9 to 4 * feat:update & merge branch.Translate fix * fix(command):fix remove command a stupid bug.Loop delete element bug. * fix(command):fix join command. When adding avatars, repeat avatars skip and non repeat avatars join. * fix(language):fix join command remove command translate * fix(ReadMe):update README.md join and remove command.
This commit is contained in:
@@ -33,10 +33,13 @@ public class JoinCommand implements CommandHandler {
|
||||
|
||||
for (int i = 0; i < args.size(); i++) {
|
||||
Avatar avatar = sender.getAvatars().getAvatarById(avatarIds.get(i));
|
||||
if (avatar == null || sender.getTeamManager().getCurrentTeamInfo().contains(avatar)) {
|
||||
if (avatar == null) {
|
||||
CommandHandler.sendMessage(sender, translate("commands.generic.invalid.avatarId"));
|
||||
return;
|
||||
}
|
||||
if (sender.getTeamManager().getCurrentTeamInfo().contains(avatar)){
|
||||
continue;
|
||||
}
|
||||
sender.getTeamManager().getCurrentTeamInfo().addAvatar(avatar);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user