diff --git a/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOffCommand.java b/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOffCommand.java index 896cc94ca4..889d52c9a9 100644 --- a/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOffCommand.java +++ b/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOffCommand.java @@ -47,7 +47,6 @@ public void execute(@Nullable TabPlayer sender, @NotNull String[] args) { return; } boolean silent = args.length == 2 && args[1].equals("-s"); - if (target.scoreboardData.otherPluginScoreboard != null) return; //not overriding other plugins scoreboard.setScoreboardVisible(target, false, !silent); } diff --git a/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOnCommand.java b/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOnCommand.java index ed4879d663..6ae012ad1b 100644 --- a/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOnCommand.java +++ b/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardOnCommand.java @@ -47,7 +47,6 @@ public void execute(@Nullable TabPlayer sender, @NotNull String[] args) { return; } boolean silent = args.length == 2 && args[1].equals("-s"); - if (target.scoreboardData.otherPluginScoreboard != null) return; //not overriding other plugins scoreboard.setScoreboardVisible(target, true, !silent); } diff --git a/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardToggleCommand.java b/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardToggleCommand.java index 58429e0756..765aba0804 100644 --- a/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardToggleCommand.java +++ b/shared/src/main/java/me/neznamy/tab/shared/command/scoreboard/ScoreboardToggleCommand.java @@ -47,7 +47,6 @@ public void execute(@Nullable TabPlayer sender, @NotNull String[] args) { return; } boolean silent = args.length == 2 && args[1].equals("-s"); - if (target.scoreboardData.otherPluginScoreboard != null) return; //not overriding other plugins scoreboard.toggleScoreboard(target, !silent); } diff --git a/shared/src/main/java/me/neznamy/tab/shared/features/scoreboard/ScoreboardManagerImpl.java b/shared/src/main/java/me/neznamy/tab/shared/features/scoreboard/ScoreboardManagerImpl.java index b1ccbe3f5f..aa0fe8416e 100644 --- a/shared/src/main/java/me/neznamy/tab/shared/features/scoreboard/ScoreboardManagerImpl.java +++ b/shared/src/main/java/me/neznamy/tab/shared/features/scoreboard/ScoreboardManagerImpl.java @@ -86,7 +86,7 @@ public String getRefreshDisplayName() { @Override public void refresh(@NotNull TabPlayer p, boolean force) { if (p.scoreboardData.forcedScoreboard != null || !hasScoreboardVisible(p) || - announcement != null || p.scoreboardData.otherPluginScoreboard != null || p.scoreboardData.joinDelayed) return; + announcement != null || p.scoreboardData.joinDelayed) return; sendHighestScoreboard(p); } @@ -98,8 +98,7 @@ public void onJoin(@NotNull TabPlayer connectedPlayer) { if (configuration.getJoinDelay() > 0) { connectedPlayer.scoreboardData.joinDelayed = true; customThread.executeLater(new TimedCaughtTask(TAB.getInstance().getCpu(), () -> { - if (connectedPlayer.scoreboardData.otherPluginScoreboard == null) - setScoreboardVisible(connectedPlayer, configuration.isHiddenByDefault() == sbOffPlayers.contains(connectedPlayer.getName()), false); + setScoreboardVisible(connectedPlayer, configuration.isHiddenByDefault() == sbOffPlayers.contains(connectedPlayer.getName()), false); connectedPlayer.scoreboardData.joinDelayed = false; }, getFeatureName(), TabConstants.CpuUsageCategory.PLAYER_JOIN), configuration.getJoinDelay()); } else { @@ -114,6 +113,7 @@ public void onJoin(@NotNull TabPlayer connectedPlayer) { * player to send scoreboard to */ public void sendHighestScoreboard(@NonNull TabPlayer p) { + if (p.scoreboardData.otherPluginScoreboard != null) return; if (!hasScoreboardVisible(p)) return; ScoreboardImpl scoreboard = (ScoreboardImpl) detectHighestScoreboard(p); ScoreboardImpl current = p.scoreboardData.activeScoreboard; @@ -273,7 +273,9 @@ public void setScoreboardVisible(@NonNull me.neznamy.tab.api.TabPlayer p, boolea if (player.scoreboardData.visible == visible) return; if (visible) { player.scoreboardData.visible = true; - sendHighestScoreboard(player); + if (player.scoreboardData.otherPluginScoreboard == null) { + sendHighestScoreboard(player); + } if (sendToggleMessage) { player.sendMessage(TAB.getInstance().getConfiguration().getMessages().getScoreboardOn(), true); } @@ -291,7 +293,9 @@ public void setScoreboardVisible(@NonNull me.neznamy.tab.api.TabPlayer p, boolea } } else { player.scoreboardData.visible = false; - unregisterScoreboard(player); + if (player.scoreboardData.otherPluginScoreboard == null) { + unregisterScoreboard(player); + } if (sendToggleMessage) { player.sendMessage(TAB.getInstance().getConfiguration().getMessages().getScoreboardOff(), true); }