SPIGOT-7544: Scoreboard#getEntries() doesn't get entries but class names

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2023-12-17 09:38:38 +11:00
parent 46c67d7108
commit 90ab7d39e5

View file

@ -189,8 +189,8 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
@Override
public ImmutableSet<OfflinePlayer> getPlayers() {
ImmutableSet.Builder<OfflinePlayer> players = ImmutableSet.builder();
for (Object playerName : board.getTrackedPlayers()) {
players.add(Bukkit.getOfflinePlayer(playerName.toString()));
for (ScoreHolder playerName : board.getTrackedPlayers()) {
players.add(Bukkit.getOfflinePlayer(playerName.getScoreboardName()));
}
return players.build();
}
@ -198,8 +198,8 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
@Override
public ImmutableSet<String> getEntries() {
ImmutableSet.Builder<String> entries = ImmutableSet.builder();
for (Object entry : board.getTrackedPlayers()) {
entries.add(entry.toString());
for (ScoreHolder entry : board.getTrackedPlayers()) {
entries.add(entry.getScoreboardName());
}
return entries.build();
}