Fix Player#setScoreboard() checking incorrect state

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot 2023-06-15 21:36:05 -04:00
parent 5480af2bba
commit 46dda8a1e6

View File

@ -1820,7 +1820,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setScoreboard(Scoreboard scoreboard) {
Preconditions.checkArgument(scoreboard != null, "Scoreboard cannot be null");
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);
}