Steaf23 / BingoReloaded

Minecraft Bingo 1.18+ Plug-In
GNU General Public License v3.0
23 stars 10 forks source link

Scoreboard Bug #8

Closed Demokrit5 closed 1 year ago

Demokrit5 commented 1 year ago

The Scoreboard does not count properly for teams with multiple players in it. This behavior occurs because for each new player you create a new BingoTeam in Method 'activateTeam(Team team)' in class io.github.steaf23.bingoreloaded.player.TeamManger.

I have fixed the bug so that a new BingoTeam is only created when it did not exist before. Further players are added to the existing BingoTeam.

I am not sure how to contribute to your repository so i send you the changed code right here. I already tested it with friends and it worked. NIce plugin by the way!

public BingoTeam activateTeam(Team team) { BingoTeam bTeam; bTeam = activeTeams.stream().filter((t) -> t.team.getName().equals(team.getName())).findFirst().orElse(null); if(bTeam == null) { FlexibleColor color = FlexibleColor.fromName(team.getName()); if (color != null) { bTeam = new BingoTeam(team, null, color.chatColor); } else { bTeam = new BingoTeam(team, null, ChatColor.WHITE); } activeTeams.add(bTeam); } return bTeam; }

Steaf23 commented 1 year ago

Hey, thanks for noticing this issue and suggesting a fix. I will implement it by the next update, which will hopefully be before the end of the year!