SPIGOT-7562: Fix Score#getScore and Score#isScoreSet
This commit is contained in:
parent
6902782005
commit
dd8cca3882
@ -42,12 +42,10 @@ final class CraftScore implements Score {
|
||||
public int getScore() {
|
||||
Scoreboard board = objective.checkState().board;
|
||||
|
||||
if (board.getTrackedPlayers().contains(entry)) { // Lazy
|
||||
ReadOnlyScoreInfo score = board.getPlayerScoreInfo(entry, objective.getHandle());
|
||||
if (score != null) { // Lazy
|
||||
return score.value();
|
||||
}
|
||||
}
|
||||
|
||||
return 0; // Lazy
|
||||
}
|
||||
@ -61,7 +59,7 @@ final class CraftScore implements Score {
|
||||
public boolean isScoreSet() {
|
||||
Scoreboard board = objective.checkState().board;
|
||||
|
||||
return board.getTrackedPlayers().contains(entry) && board.getPlayerScoreInfo(entry, objective.getHandle()) != null;
|
||||
return board.getPlayerScoreInfo(entry, objective.getHandle()) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user