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:
lsCoding666
2022-05-15 14:27:23 +08:00
committed by GitHub
parent d39de7eaf4
commit 722d53c9c2
7 changed files with 189 additions and 177 deletions

View File

@@ -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);
}