mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
SPIGOT-5554: Clear error message when BossBar is used for not fully joined players
This commit is contained in:
parent
18168500ea
commit
df371c1b69
1 changed files with 5 additions and 0 deletions
|
@ -166,11 +166,16 @@ public class CraftBossBar implements BossBar {
|
|||
|
||||
@Override
|
||||
public void addPlayer(Player player) {
|
||||
Preconditions.checkArgument(player != null, "player == null");
|
||||
Preconditions.checkArgument(((CraftPlayer) player).getHandle().playerConnection != null, "player is not fully connected (wait for PlayerJoinEvent)");
|
||||
|
||||
handle.addPlayer(((CraftPlayer) player).getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePlayer(Player player) {
|
||||
Preconditions.checkArgument(player != null, "player == null");
|
||||
|
||||
handle.removePlayer(((CraftPlayer) player).getHandle());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue