Search in sources :

Example 1 with BossBattleServer

use of net.minecraft.server.v1_12_R1.BossBattleServer in project Citizens2 by CitizensDev.

the class NMSImpl method getBossBar.

public static BossBar getBossBar(org.bukkit.entity.Entity entity) {
    BossBattleServer bserver = null;
    try {
        if (entity.getType() == EntityType.WITHER) {
            bserver = (BossBattleServer) WITHER_BOSS_BAR_FIELD.get(NMSImpl.getHandle(entity));
        } else if (entity.getType() == EntityType.ENDER_DRAGON) {
            bserver = (BossBattleServer) ENDERDRAGON_BATTLE_BAR_FIELD.get(ENDERDRAGON_BATTLE_FIELD.get(NMSImpl.getHandle(entity)));
        }
    } catch (Exception e) {
    }
    if (bserver == null) {
        return null;
    }
    BossBar ret = Bukkit.createBossBar("", BarColor.BLUE, BarStyle.SEGMENTED_10);
    try {
        CRAFT_BOSSBAR_HANDLE_FIELD.set(ret, bserver);
    } catch (Exception e) {
    }
    return ret;
}
Also used : BossBar(org.bukkit.boss.BossBar) CraftBossBar(org.bukkit.craftbukkit.v1_12_R1.boss.CraftBossBar) BossBattleServer(net.minecraft.server.v1_12_R1.BossBattleServer) ReportedException(net.minecraft.server.v1_12_R1.ReportedException) CommandException(net.citizensnpcs.api.command.exception.CommandException)

Example 2 with BossBattleServer

use of net.minecraft.server.v1_12_R1.BossBattleServer in project Citizens2 by CitizensDev.

the class NMSImpl method getBossBar.

public static BossBar getBossBar(org.bukkit.entity.Entity entity) {
    BossBattleServer bserver = null;
    try {
        if (entity.getType() == EntityType.WITHER) {
            bserver = (BossBattleServer) WITHER_BOSS_BAR_FIELD.get(NMSImpl.getHandle(entity));
        } else if (entity.getType() == EntityType.ENDER_DRAGON) {
            bserver = (BossBattleServer) ENDERDRAGON_BATTLE_BAR_FIELD.get(ENDERDRAGON_BATTLE_FIELD.get(NMSImpl.getHandle(entity)));
        }
    } catch (Exception e) {
    }
    if (bserver == null) {
        return null;
    }
    BossBar ret = Bukkit.createBossBar("", BarColor.BLUE, BarStyle.SEGMENTED_10);
    try {
        CRAFT_BOSSBAR_HANDLE_FIELD.set(ret, bserver);
    } catch (Exception e) {
    }
    return ret;
}
Also used : BossBar(org.bukkit.boss.BossBar) CraftBossBar(org.bukkit.craftbukkit.v1_11_R1.boss.CraftBossBar) BossBattleServer(net.minecraft.server.v1_11_R1.BossBattleServer) ReportedException(net.minecraft.server.v1_11_R1.ReportedException) CommandException(net.citizensnpcs.api.command.exception.CommandException)

Example 3 with BossBattleServer

use of net.minecraft.server.v1_12_R1.BossBattleServer in project Citizens2 by CitizensDev.

the class NMSImpl method getBossBar.

public static BossBar getBossBar(org.bukkit.entity.Entity entity) {
    BossBattleServer bserver = null;
    try {
        if (entity.getType() == EntityType.WITHER) {
            bserver = (BossBattleServer) WITHER_BOSS_BAR_FIELD.get(NMSImpl.getHandle(entity));
        } else if (entity.getType() == EntityType.ENDER_DRAGON) {
            bserver = (BossBattleServer) ENDERDRAGON_BATTLE_BAR_FIELD.get(ENDERDRAGON_BATTLE_FIELD.get(NMSImpl.getHandle(entity)));
        }
    } catch (Exception e) {
    }
    if (bserver == null) {
        return null;
    }
    BossBar ret = Bukkit.createBossBar("", BarColor.BLUE, BarStyle.SEGMENTED_10);
    try {
        CRAFT_BOSSBAR_HANDLE_FIELD.set(ret, bserver);
    } catch (Exception e) {
    }
    return ret;
}
Also used : BossBar(org.bukkit.boss.BossBar) CraftBossBar(org.bukkit.craftbukkit.v1_10_R1.boss.CraftBossBar) BossBattleServer(net.minecraft.server.v1_10_R1.BossBattleServer) ReportedException(net.minecraft.server.v1_10_R1.ReportedException) CommandException(net.citizensnpcs.api.command.exception.CommandException)

Aggregations

CommandException (net.citizensnpcs.api.command.exception.CommandException)3 BossBar (org.bukkit.boss.BossBar)3 BossBattleServer (net.minecraft.server.v1_10_R1.BossBattleServer)1 ReportedException (net.minecraft.server.v1_10_R1.ReportedException)1 BossBattleServer (net.minecraft.server.v1_11_R1.BossBattleServer)1 ReportedException (net.minecraft.server.v1_11_R1.ReportedException)1 BossBattleServer (net.minecraft.server.v1_12_R1.BossBattleServer)1 ReportedException (net.minecraft.server.v1_12_R1.ReportedException)1 CraftBossBar (org.bukkit.craftbukkit.v1_10_R1.boss.CraftBossBar)1 CraftBossBar (org.bukkit.craftbukkit.v1_11_R1.boss.CraftBossBar)1 CraftBossBar (org.bukkit.craftbukkit.v1_12_R1.boss.CraftBossBar)1