From 1b18546cb86e0e97b45f140bf2e0f8afaaf53c7d Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Mon, 4 Nov 2024 11:26:01 +0100 Subject: [PATCH] Quick hotfix to prevent stackoverflow from happening (#10398) 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. --- .../api/entity/other/AbstractFastMinecoloniesEntity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minecolonies/api/entity/other/AbstractFastMinecoloniesEntity.java b/src/main/java/com/minecolonies/api/entity/other/AbstractFastMinecoloniesEntity.java index 1b871a315f7..241f9e03f33 100644 --- a/src/main/java/com/minecolonies/api/entity/other/AbstractFastMinecoloniesEntity.java +++ b/src/main/java/com/minecolonies/api/entity/other/AbstractFastMinecoloniesEntity.java @@ -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); + } } /**