Check current character index

This commit is contained in:
KingRainbow44 2023-04-30 00:30:03 -04:00
parent 9b507a6ec3
commit 48dd1685a2
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -132,6 +132,10 @@ public final class TeamManager extends BasePlayerDataManager {
} }
public EntityAvatar getCurrentAvatarEntity() { public EntityAvatar getCurrentAvatarEntity() {
if (this.currentCharacterIndex >= this.getActiveTeam().size()) {
this.currentCharacterIndex = 0; // Reset to the first character.
}
return this.getActiveTeam().get(this.currentCharacterIndex); return this.getActiveTeam().get(this.currentCharacterIndex);
} }