Skip to content

Commit

Permalink
[Scoreboard] Fix detection of scoreboards from other plugins not rese…
Browse files Browse the repository at this point in the history
…tting on server switch
  • Loading branch information
NEZNAMY committed Nov 23, 2024
1 parent acee89c commit e182366
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class ScoreboardManagerImpl extends RefreshableFeature implements ScoreboardManager, JoinListener,
CommandListener, DisplayObjectiveListener, ObjectiveListener, Loadable,
QuitListener, CustomThreaded {
QuitListener, CustomThreaded, ServerSwitchListener {

/** Objective name used by this feature */
public static final String OBJECTIVE_NAME = "TAB-Scoreboard";
Expand Down Expand Up @@ -356,6 +356,14 @@ public String getFeatureName() {
return "Scoreboard";
}

@Override
public void onServerChange(@NotNull TabPlayer changed, @NotNull String from, @NotNull String to) {
if (changed.scoreboardData.otherPluginScoreboard != null) {
changed.scoreboardData.otherPluginScoreboard = null;
sendHighestScoreboard(changed);
}
}

/**
* Class storing scoreboard data of players.
*/
Expand Down

0 comments on commit e182366

Please sign in to comment.