Java Code Examples for org.bukkit.boss.BossBar#removePlayer()

The following examples show how to use org.bukkit.boss.BossBar#removePlayer() . 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: LugolsIodineDisplay.java    From CraftserveRadiation with Apache License 2.0 5 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
    Player player = event.getPlayer();

    BossBar bossBar = this.displayMap.get(player.getUniqueId());
    if (bossBar != null) {
        bossBar.removePlayer(player);
    }
}
 
Example 2
Source File: LugolsIodineDisplay.java    From CraftserveRadiation with Apache License 2.0 5 votes vote down vote up
private void remove(Player player) {
    Objects.requireNonNull(player, "player");

    UUID playerId = player.getUniqueId();
    BossBar bossBar = this.displayMap.get(playerId);

    if (bossBar != null) {
        bossBar.removePlayer(player);
        this.displayMap.remove(playerId);
    }
}
 
Example 3
Source File: TicketDisplay.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
@HandleModel
public void ticketUpdated(@Nullable Ticket before, @Nullable Ticket after, Ticket latest) {
    final Arena arena = arenas.byId(latest.arena_id());
    updateArena(arena);

    final Player player = userStore.find(latest.user());
    if(player != null) {
        final BossBar bar = bars.getUnchecked(arena);
        if(after != null && after.server_id() == null) {
            bar.addPlayer(player);
        } else {
            bar.removePlayer(player);
        }
    }
}
 
Example 4
Source File: BossBarManager.java    From skRayFall with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Remove an array of players from a bossbar in the BossBarManager through the stored ID.
 *
 * @param id      The ID text for the bossbar.
 * @param players Array of players to be removed from the bossbar
 */
void removePlayers(String id, Player[] players) {
    BossBar bar = barMap.get(id);
    if (bar != null) {
        for (Player p : players) {
            bar.removePlayer(p);
        }
        barMap.put(id, bar);
    }
}
 
Example 5
Source File: BossAnnouncer.java    From HubBasics with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void remBossBar(Player player) {
    BossBar bossBar = playerBars.getOrDefault(player.getUniqueId(), null);
    if (bossBar != null) {
        bossBar.removePlayer(player);
        playerBars.remove(player.getUniqueId());
    }
}
 
Example 6
Source File: RenderedBossBar.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void removePlayer(Player player) {
    final BossBar view = views.remove(player);
    if(view != null) view.removePlayer(player);
}