Search in sources :

Example 1 with BossBar

use of pl.themolka.arcade.bossbar.BossBar in project Arcade2 by ShootGame.

the class PointBossBarRender method renderBossBar.

public BossBar renderBossBar(Point point, Color pointColor, double progress, Color progressColor) {
    BossBar bossBar = this.bossBars.get(point);
    if (bossBar == null) {
        this.bossBars.put(point, bossBar = new BossBar(BAR_COLOR, BAR_STYLE, BAR_FLAGS));
    }
    bossBar.setColor(BossBarUtils.color(pointColor, BAR_COLOR));
    bossBar.setProgress(Percentage.finite(progress));
    bossBar.setText(this.createBarTitle(point.getName(), pointColor, progress, progressColor));
    return bossBar;
}
Also used : BossBar(pl.themolka.arcade.bossbar.BossBar)

Example 2 with BossBar

use of pl.themolka.arcade.bossbar.BossBar in project Arcade2 by ShootGame.

the class CycleCountdown method onTick.

@Override
public void onTick(long ticks) {
    if (!this.plugin.getGames().getQueue().hasNextMap()) {
        this.cancelCountdown();
        return;
    } else if (this.getProgress() > 1) {
        return;
    }
    OfflineMap nextMap = this.plugin.getGames().getQueue().getNextMap();
    Game game = this.plugin.getGames().getCurrentGame();
    if (game == null) {
        return;
    }
    String message = this.getPrintMessage(this.getCycleMessage(nextMap.getName()));
    BossBar bossBar = this.getBossBar();
    bossBar.setProgress(Percentage.finite(this.getProgress()));
    bossBar.setText(new TextComponent(message));
    for (ArcadePlayer online : this.plugin.getPlayers()) {
        GamePlayer player = online.getGamePlayer();
        if (player != null) {
            bossBar.addPlayer(player, BAR_PRIORITY);
        }
    }
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) Game(pl.themolka.arcade.game.Game) ArcadePlayer(pl.themolka.arcade.session.ArcadePlayer) GamePlayer(pl.themolka.arcade.game.GamePlayer) OfflineMap(pl.themolka.arcade.map.OfflineMap) BossBar(pl.themolka.arcade.bossbar.BossBar)

Example 3 with BossBar

use of pl.themolka.arcade.bossbar.BossBar in project Arcade2 by ShootGame.

the class RestartCountdown method onTick.

@Override
public void onTick(long ticks) {
    Game game = this.plugin.getGames().getCurrentGame();
    if (game == null) {
        return;
    } else if (this.getProgress() > 1) {
        return;
    }
    String message = this.getPrintMessage(this.getRestartMessage());
    BossBar bossBar = this.getBossBar();
    bossBar.setProgress(Percentage.finite(this.getProgress()));
    bossBar.setText(new TextComponent(message));
    for (ArcadePlayer online : this.plugin.getPlayers()) {
        GamePlayer player = online.getGamePlayer();
        if (player != null) {
            bossBar.addPlayer(player, BAR_PRIORITY);
        }
    }
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) ArcadePlayer(pl.themolka.arcade.session.ArcadePlayer) BossBar(pl.themolka.arcade.bossbar.BossBar)

Example 4 with BossBar

use of pl.themolka.arcade.bossbar.BossBar in project Arcade2 by ShootGame.

the class MatchStartCountdown method onTick.

@Override
public void onTick(long ticks) {
    Game game = this.plugin.getGames().getCurrentGame();
    if (game == null) {
        return;
    } else if (this.getProgress() > 1) {
        return;
    }
    String message = this.getPrintMessage(this.getStartMessage());
    BossBar bossBar = this.getBossBar();
    bossBar.setProgress(Percentage.finite(this.getProgress()));
    bossBar.setText(new TextComponent(message));
    for (ArcadePlayer online : this.plugin.getPlayers()) {
        GamePlayer player = online.getGamePlayer();
        if (player != null) {
            bossBar.addPlayer(player, BAR_PRIORITY);
        }
    }
}
Also used : TextComponent(net.md_5.bungee.api.chat.TextComponent) Game(pl.themolka.arcade.game.Game) ArcadePlayer(pl.themolka.arcade.session.ArcadePlayer) GamePlayer(pl.themolka.arcade.game.GamePlayer) BossBar(pl.themolka.arcade.bossbar.BossBar)

Aggregations

BossBar (pl.themolka.arcade.bossbar.BossBar)4 TextComponent (net.md_5.bungee.api.chat.TextComponent)3 ArcadePlayer (pl.themolka.arcade.session.ArcadePlayer)3 Game (pl.themolka.arcade.game.Game)2 GamePlayer (pl.themolka.arcade.game.GamePlayer)2 OfflineMap (pl.themolka.arcade.map.OfflineMap)1