Search in sources :

Example 21 with BossBar

use of org.bukkit.boss.BossBar in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_10_R1 method showSimpleBossBar.

@Override
public void showSimpleBossBar(Player player, String title, double progress) {
    UUID uuid = player.getUniqueId();
    if (!bossBars.containsKey(uuid)) {
        bossBars.put(uuid, new ArrayList<BossBar>());
    }
    List<BossBar> playerBars = bossBars.get(uuid);
    if (!playerBars.isEmpty()) {
        Iterator<BossBar> iterator = playerBars.iterator();
        while (iterator.hasNext()) {
            BossBar bossBar = iterator.next();
            bossBar.removePlayer(player);
            iterator.remove();
        }
    }
    BossBar bossBar = Bukkit.createBossBar(title, BarColor.PURPLE, BarStyle.SOLID);
    bossBar.setProgress(progress);
    bossBar.addPlayer(player);
    bossBar.setVisible(true);
    playerBars.add(bossBar);
}
Also used : BossBar(org.bukkit.boss.BossBar) UUID(java.util.UUID)

Example 22 with BossBar

use of org.bukkit.boss.BossBar in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_11_R1 method showSimpleBossBar.

@Override
public void showSimpleBossBar(Player player, String title, double progress) {
    UUID uuid = player.getUniqueId();
    if (!bossBars.containsKey(uuid)) {
        bossBars.put(uuid, new ArrayList<BossBar>());
    }
    List<BossBar> playerBars = bossBars.get(uuid);
    if (!playerBars.isEmpty()) {
        Iterator<BossBar> iterator = playerBars.iterator();
        while (iterator.hasNext()) {
            BossBar bossBar = iterator.next();
            bossBar.removePlayer(player);
            iterator.remove();
        }
    }
    BossBar bossBar = Bukkit.createBossBar(title, BarColor.PURPLE, BarStyle.SOLID);
    bossBar.setProgress(progress);
    bossBar.addPlayer(player);
    bossBar.setVisible(true);
    playerBars.add(bossBar);
}
Also used : BossBar(org.bukkit.boss.BossBar) UUID(java.util.UUID)

Example 23 with BossBar

use of org.bukkit.boss.BossBar in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_9_R2 method showSimpleBossBar.

@Override
public void showSimpleBossBar(Player player, String title, double progress) {
    UUID uuid = player.getUniqueId();
    if (!bossBars.containsKey(uuid)) {
        bossBars.put(uuid, new ArrayList<BossBar>());
    }
    List<BossBar> playerBars = bossBars.get(uuid);
    if (!playerBars.isEmpty()) {
        Iterator<BossBar> iterator = playerBars.iterator();
        while (iterator.hasNext()) {
            BossBar bossBar = iterator.next();
            bossBar.removePlayer(player);
            iterator.remove();
        }
    }
    BossBar bossBar = Bukkit.createBossBar(title, BarColor.PURPLE, BarStyle.SOLID);
    bossBar.setProgress(progress);
    bossBar.addPlayer(player);
    bossBar.setVisible(true);
    playerBars.add(bossBar);
}
Also used : BossBar(org.bukkit.boss.BossBar) UUID(java.util.UUID)

Example 24 with BossBar

use of org.bukkit.boss.BossBar in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_9_R2 method removeSimpleBossBar.

@Override
public void removeSimpleBossBar(Player player) {
    UUID uuid = player.getUniqueId();
    if (bossBars.containsKey(uuid) && !bossBars.get(uuid).isEmpty()) {
        Iterator<BossBar> iterator = bossBars.get(uuid).iterator();
        while (iterator.hasNext()) {
            BossBar bossBar = iterator.next();
            bossBar.removePlayer(player);
            iterator.remove();
        }
    }
}
Also used : BossBar(org.bukkit.boss.BossBar) UUID(java.util.UUID)

Example 25 with BossBar

use of org.bukkit.boss.BossBar in project RedProtect by FabioZumbi12.

the class RPMine111 method sendBarMsg.

public static void sendBarMsg(String msg, String color, Player p) {
    BossBar bar = Bukkit.createBossBar(msg, BarColor.valueOf(color), BarStyle.SEGMENTED_10);
    bar.addPlayer(p);
    removeBar(bar, p);
}
Also used : BossBar(org.bukkit.boss.BossBar)

Aggregations

BossBar (org.bukkit.boss.BossBar)33 UUID (java.util.UUID)6 Location (org.bukkit.Location)5 BarFlag (org.bukkit.boss.BarFlag)5 Player (org.bukkit.entity.Player)5 Vector (org.bukkit.util.Vector)5 ArmorStand (org.bukkit.entity.ArmorStand)4 Seat (me.legofreak107.vehicles.objects.Seat)3 Vehicle (me.legofreak107.vehicles.objects.Vehicle)3 CommandException (net.citizensnpcs.api.command.exception.CommandException)3 EntityArmorStand (net.minecraft.server.v1_12_R1.EntityArmorStand)3 PacketPlayInSteerVehicle (net.minecraft.server.v1_12_R1.PacketPlayInSteerVehicle)3 BarColor (org.bukkit.boss.BarColor)3 BarStyle (org.bukkit.boss.BarStyle)3 CraftArmorStand (org.bukkit.craftbukkit.v1_12_R1.entity.CraftArmorStand)3 PlayerInventory (org.bukkit.inventory.PlayerInventory)3 java.util (java.util)2 LivingEntity (org.bukkit.entity.LivingEntity)2 EulerAngle (org.bukkit.util.EulerAngle)2 Denizen (com.denizenscript.denizen.Denizen)1