Advertisement
Rickylachow

Untitled

Oct 24th, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. public void BossBar(){
  2. BossBar bossBar = BossBar.bossBar(
  3. Component.text("Un attacco al forte Γ¨ in corso! - /clan combatti per raggiungere il luogo"),
  4. 1.0f,
  5. BossBar.Color.PINK,
  6. BossBar.Overlay.NOTCHED_20
  7. );
  8. Bukkit.getOnlinePlayers().forEach(player -> {
  9. if (!player.equals(Guerra.get("guerra"))) {
  10. this.task2 = new BukkitRunnable() {
  11. int seconds = 220;
  12. @Override
  13. public void run() {
  14. if (Guerra.containsKey("guerra")) {
  15. if ((seconds -= 1) == 0) {
  16. task2.cancel();
  17. task2 = null;
  18. player.hideBossBar(bossBar);
  19. player.sendMessage(Parser.parseKyori(" <green>La conquista Γ¨ terminata con successo!"));
  20. } else {
  21. bossBar.progress((float) (seconds / 220D));
  22. }
  23. } else {
  24. task2.cancel();
  25. task2 = null;
  26. player.hideBossBar(bossBar);
  27. player.sendMessage(Parser.parseKyori("<red> Qualcosa Γ¨ andato storto, la guerra Γ¨ terminata.."));
  28. }
  29. }
  30. }.runTaskTimer(instance, 0, 50);
  31. player.showBossBar(bossBar);
  32. }});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement