From 4bd4cdc510cdf7516ac901a9931918c3efb95c4c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 2 Nov 2020 18:12:26 +0100 Subject: [PATCH] Hotfix team --- src/de/steamwar/spectatesystem/elements/RPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/spectatesystem/elements/RPlayer.java b/src/de/steamwar/spectatesystem/elements/RPlayer.java index d284fd9..ac93b03 100644 --- a/src/de/steamwar/spectatesystem/elements/RPlayer.java +++ b/src/de/steamwar/spectatesystem/elements/RPlayer.java @@ -41,9 +41,13 @@ import java.util.logging.Level; public class RPlayer extends REntity { - private static Team team = Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("Replay"); + private static final Team team; static { + if(Bukkit.getScoreboardManager().getMainScoreboard().getTeam("Replay") != null) + team = Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("Replay"); + else + team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam("Replay"); team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER); team.setNameTagVisibility(NameTagVisibility.NEVER); }