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;
}
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);
}
}
}
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);
}
}
}
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);
}
}
}
Aggregations