Remove connected check on setScoreboard

No other API uses such a check and it has been removed in Spigot since f7086eb96d9977d717af75c0dd2eb38349b2df2b in 2013.
This commit is contained in:
md_5 2023-12-23 08:39:28 +11:00
parent f90ce621ef
commit 465ec3fb42
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -1917,7 +1917,6 @@ 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)");
this.server.getScoreboardManager().setPlayerBoard(this, scoreboard); this.server.getScoreboardManager().setPlayerBoard(this, scoreboard);
} }