Skip to content

Commit

Permalink
Quick hotfix to prevent stackoverflow from happening (#10398)
Browse files Browse the repository at this point in the history
Due to a recent change in registerWithColony, the team behaviour code wasn't rechecked and now causes a stackoverflow in the code. As a quick patch just disable the method whilst we look more in depth for a better solution.
  • Loading branch information
Thodor12 authored Nov 4, 2024
1 parent 88a5dbf commit 1b18546
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ private boolean isInTeam(@NotNull final PlayerTeam team)
public void remove(@NotNull final RemovalReason reason)
{
super.remove(reason);
removeFromTeam();
final PlayerTeam playersTeam = level.getScoreboard().getPlayersTeam(getScoreboardName());
if (playersTeam != null)
{
level.getScoreboard().removePlayerFromTeam(getScoreboardName(), playersTeam);
}
}

/**
Expand Down

0 comments on commit 1b18546

Please sign in to comment.