Fix Player#setScoreboard() checking incorrect state
This commit is contained in:
parent
9a21b0b89e
commit
3b557627cd
@ -1820,7 +1820,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public void setScoreboard(Scoreboard scoreboard) {
|
public void setScoreboard(Scoreboard scoreboard) {
|
||||||
Preconditions.checkArgument(scoreboard != null, "Scoreboard cannot be null");
|
Preconditions.checkArgument(scoreboard != null, "Scoreboard cannot be null");
|
||||||
Preconditions.checkState(getHandle().connection != null, "Cannot set scoreboard yet (invalid player connection)");
|
Preconditions.checkState(getHandle().connection != null, "Cannot set scoreboard yet (invalid player connection)");
|
||||||
Preconditions.checkState(getHandle().connection.isDisconnected(), "Cannot set scoreboard for invalid CraftPlayer (player is disconnected)");
|
Preconditions.checkState(!getHandle().connection.isDisconnected(), "Cannot set scoreboard for invalid CraftPlayer (player is disconnected)");
|
||||||
|
|
||||||
this.server.getScoreboardManager().setPlayerBoard(this, scoreboard);
|
this.server.getScoreboardManager().setPlayerBoard(this, scoreboard);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user