Java Code Examples for org.bukkit.entity.Player#willBeOnline()

The following examples show how to use org.bukkit.entity.Player#willBeOnline() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IdentityProviderImpl.java    From ProjectAres with GNU Affero General Public License v3.0 6 votes vote down vote up
protected void applyNickname(Player player, @Nullable String oldNickname, @Nullable String newNickname) {
    validateNickname(newNickname);

    if(oldNickname != null) {
        nicknames.remove(oldNickname);
    }

    final Identity identity = createIdentity(userStore.getUser(player), newNickname);
    if(player.willBeOnline()) {
        identities.put(player, identity);

        if(newNickname != null) {
            nicknames.put(newNickname, player);
        }
    }
}
 
Example 2
Source File: IdentityProviderImpl.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
private Identity currentIdentity(PlayerId playerId, @Nullable Player player) {
    Identity identity = identities.get(player);
    if(identity == null) {
        identity = createIdentity(playerId, null);
        if(player != null && player.willBeOnline()) {
            identities.put(player, identity);
        }
    }
    return identity;
}
 
Example 3
Source File: OnlinePlayerMapAdapter.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public boolean isValid(Player key) {
    return key.willBeOnline();
}
 
Example 4
Source File: TabManager.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
public TabEntry getPlayerEntry(Player player) {
    if(!player.willBeOnline()) {
        throw new IllegalStateException("Tried to get TabEntry for disconnecting player");
    }
    return this.playerEntries.get(player);
}