mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 07:17:46 +01:00
SPIGOT-7562: Fix Score#getScore and Score#isScoreSet
By: md_5 <git@md-5.net>
This commit is contained in:
parent
5e82782283
commit
71ca5a7bdf
@ -42,11 +42,9 @@ 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();
|
||||
}
|
||||
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…
Reference in New Issue
Block a user