mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +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() {
|
public int getScore() {
|
||||||
Scoreboard board = objective.checkState().board;
|
Scoreboard board = objective.checkState().board;
|
||||||
|
|
||||||
if (board.getTrackedPlayers().contains(entry)) { // Lazy
|
ReadOnlyScoreInfo score = board.getPlayerScoreInfo(entry, objective.getHandle());
|
||||||
ReadOnlyScoreInfo score = board.getPlayerScoreInfo(entry, objective.getHandle());
|
if (score != null) { // Lazy
|
||||||
if (score != null) { // Lazy
|
return score.value();
|
||||||
return score.value();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; // Lazy
|
return 0; // Lazy
|
||||||
@ -61,7 +59,7 @@ final class CraftScore implements Score {
|
|||||||
public boolean isScoreSet() {
|
public boolean isScoreSet() {
|
||||||
Scoreboard board = objective.checkState().board;
|
Scoreboard board = objective.checkState().board;
|
||||||
|
|
||||||
return board.getTrackedPlayers().contains(entry) && board.getPlayerScoreInfo(entry, objective.getHandle()) != null;
|
return board.getPlayerScoreInfo(entry, objective.getHandle()) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user