us.myles.ViaVersion.api.boss.BossColor Java Examples

The following examples show how to use us.myles.ViaVersion.api.boss.BossColor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ViaBossBarFactory.java    From helper with MIT License 6 votes vote down vote up
private static BossBarColor convertColor(BossColor color) {
    switch (color) {
        case PINK:
            return BossBarColor.PINK;
        case BLUE:
            return BossBarColor.BLUE;
        case RED:
            return BossBarColor.RED;
        case GREEN:
            return BossBarColor.GREEN;
        case YELLOW:
            return BossBarColor.YELLOW;
        case PURPLE:
            return BossBarColor.PURPLE;
        case WHITE:
            return BossBarColor.WHITE;
        default:
            return BossBarColor.defaultColor();
    }
}
 
Example #2
Source File: ViaBossBarFactory.java    From helper with MIT License 6 votes vote down vote up
private static BossColor convertColor(BossBarColor color) {
    switch (color) {
        case PINK:
            return BossColor.PINK;
        case BLUE:
            return BossColor.BLUE;
        case RED:
            return BossColor.RED;
        case GREEN:
            return BossColor.GREEN;
        case YELLOW:
            return BossColor.YELLOW;
        case PURPLE:
            return BossColor.PURPLE;
        case WHITE:
            return BossColor.WHITE;
        default:
            return convertColor(BossBarColor.defaultColor());
    }
}
 
Example #3
Source File: CommonBoss.java    From ViaVersion with MIT License 5 votes vote down vote up
@Override
public BossBar setColor(BossColor color) {
    Preconditions.checkNotNull(color);
    this.color = color;
    sendPacket(CommonBoss.UpdateAction.UPDATE_STYLE);
    return this;
}
 
Example #4
Source File: CommonBoss.java    From ViaVersion with MIT License 5 votes vote down vote up
public CommonBoss(String title, float health, BossColor color, BossStyle style) {
    Preconditions.checkNotNull(title, "Title cannot be null");
    Preconditions.checkArgument((health >= 0 && health <= 1), "Health must be between 0 and 1");

    this.uuid = UUID.randomUUID();
    this.title = title;
    this.health = health;
    this.color = color == null ? BossColor.PURPLE : color;
    this.style = style == null ? BossStyle.SOLID : style;
    this.connections = Collections.newSetFromMap(new WeakHashMap<>());
    this.flags = new HashSet<>();
    visible = true;
}
 
Example #5
Source File: BungeeBossBar.java    From ViaVersion with MIT License 4 votes vote down vote up
public BungeeBossBar(String title, float health, BossColor color, BossStyle style) {
    super(title, health, color, style);
}
 
Example #6
Source File: CommonBoss.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossColor getColor() {
    return color;
}
 
Example #7
Source File: VelocityViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar createBossBar(String title, float health, BossColor color, BossStyle style) {
    return new VelocityBossBar(title, health, color, style);
}
 
Example #8
Source File: VelocityViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar createBossBar(String title, BossColor color, BossStyle style) {
    return new VelocityBossBar(title, 1F, color, style);
}
 
Example #9
Source File: VelocityBossBar.java    From ViaVersion with MIT License 4 votes vote down vote up
public VelocityBossBar(String title, float health, BossColor color, BossStyle style) {
    super(title, health, color, style);
}
 
Example #10
Source File: SpongeViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar createBossBar(String title, float health, BossColor color, BossStyle style) {
    return new SpongeBossBar(title, health, color, style);
}
 
Example #11
Source File: SpongeViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar createBossBar(String title, BossColor color, BossStyle style) {
    return new SpongeBossBar(title, 1F, color, style);
}
 
Example #12
Source File: SpongeBossBar.java    From ViaVersion with MIT License 4 votes vote down vote up
public SpongeBossBar(String title, float health, BossColor color, BossStyle style) {
    super(title, health, color, style);
}
 
Example #13
Source File: VRViaAPI.java    From ViaFabric with MIT License 4 votes vote down vote up
@Override
public BossBar<Void> createBossBar(String s, BossColor bossColor, BossStyle bossStyle) {
    return new VRBossBar(s, 1f, bossColor, bossStyle);
}
 
Example #14
Source File: BungeeViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar createBossBar(String title, float health, BossColor color, BossStyle style) {
    return new BungeeBossBar(title, health, color, style);
}
 
Example #15
Source File: BungeeViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar createBossBar(String title, BossColor color, BossStyle style) {
    return new BungeeBossBar(title, 1F, color, style);
}
 
Example #16
Source File: ViaBossBar.java    From ViaVersion with MIT License 4 votes vote down vote up
public ViaBossBar(String title, float health, BossColor color, BossStyle style) {
    super(title, health, color, style);
}
 
Example #17
Source File: BukkitViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar<Player> createBossBar(String title, float health, BossColor color, BossStyle style) {
    return new ViaBossBar(title, health, color, style);
}
 
Example #18
Source File: BukkitViaAPI.java    From ViaVersion with MIT License 4 votes vote down vote up
@Override
public BossBar<Player> createBossBar(String title, BossColor color, BossStyle style) {
    return new ViaBossBar(title, 1F, color, style);
}
 
Example #19
Source File: WitherBossBar.java    From ViaRewind with MIT License 4 votes vote down vote up
@Override
public BossBar setColor(BossColor bossColor) {
	throw new UnsupportedOperationException(this.getClass().getName() + " does not support color");
}
 
Example #20
Source File: WitherBossBar.java    From ViaRewind with MIT License 4 votes vote down vote up
@Override
public BossColor getColor() {
	return null;
}
 
Example #21
Source File: VRBossBar.java    From ViaFabric with MIT License 4 votes vote down vote up
public VRBossBar(String title, float health, BossColor color, BossStyle style) {
    super(title, health, color, style);
}
 
Example #22
Source File: VRViaAPI.java    From ViaFabric with MIT License 4 votes vote down vote up
@Override
public BossBar<Void> createBossBar(String s, float v, BossColor bossColor, BossStyle bossStyle) {
    return new VRBossBar(s, v, bossColor, bossStyle);
}
 
Example #23
Source File: ViaAPI.java    From ViaVersion with MIT License 2 votes vote down vote up
/**
 * Create a new bossbar instance
 *
 * @param title The title
 * @param color The color
 * @param style The style
 * @return BossBar instance
 */
BossBar createBossBar(String title, BossColor color, BossStyle style);
 
Example #24
Source File: ViaAPI.java    From ViaVersion with MIT License 2 votes vote down vote up
/**
 * Create a new bossbar instance
 *
 * @param title  The title
 * @param health Number between 0 and 1
 * @param color  The color
 * @param style  The style
 * @return BossBar instance
 */
BossBar createBossBar(String title, float health, BossColor color, BossStyle style);