Java Code Examples for net.kyori.text.format.TextColor#YELLOW

The following examples show how to use net.kyori.text.format.TextColor#YELLOW . 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: GDActiveFlagData.java    From GriefDefender with MIT License 6 votes vote down vote up
public TextColor getColor() {
    if (this.type == Type.CLAIM) {
        return TextColor.YELLOW;
    }
    if (this.type == Type.CLAIM_PARENT_INHERIT) {
        return TextColor.AQUA;
    }
    if (this.type == Type.OVERRIDE) {
        return TextColor.RED;
    }
    if (this.type == Type.OWNER_OVERRIDE_PARENT_INHERIT) {
        return TextColor.DARK_RED;
    }
    if (this.type == Type.DEFAULT) {
        return TextColor.LIGHT_PURPLE;
    }
    return TextColor.GRAY;
}
 
Example 2
Source File: GDActiveFlagData.java    From GriefDefender with MIT License 6 votes vote down vote up
public TextColor getColor() {
    if (this.type == Type.CLAIM) {
        return TextColor.YELLOW;
    }
    if (this.type == Type.CLAIM_PARENT_INHERIT) {
        return TextColor.AQUA;
    }
    if (this.type == Type.OVERRIDE) {
        return TextColor.RED;
    }
    if (this.type == Type.OWNER_OVERRIDE_PARENT_INHERIT) {
        return TextColor.DARK_RED;
    }
    if (this.type == Type.DEFAULT) {
        return TextColor.LIGHT_PURPLE;
    }
    return TextColor.GRAY;
}
 
Example 3
Source File: MatchCountdown.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
protected TextColor urgencyColor() {
  long seconds = remaining.getSeconds();
  if (seconds > 60) {
    return TextColor.GREEN;
  } else if (seconds > 30) {
    return TextColor.YELLOW;
  } else if (seconds > 5) {
    return TextColor.GOLD;
  } else {
    return TextColor.DARK_RED;
  }
}
 
Example 4
Source File: HealthModule.java    From spark with GNU General Public License v3.0 5 votes vote down vote up
public static TextComponent formatTps(double tps) {
    TextColor color;
    if (tps > 18.0) {
        color = TextColor.GREEN;
    } else if (tps > 16.0) {
        color = TextColor.YELLOW;
    } else {
        color = TextColor.RED;
    }

    return TextComponent.of( (tps > 20.0 ? "*" : "") + Math.min(Math.round(tps * 100.0) / 100.0, 20.0), color);
}
 
Example 5
Source File: HealthModule.java    From spark with GNU General Public License v3.0 5 votes vote down vote up
public static TextComponent formatTickDuration(double duration){
    TextColor color;
    if (duration >= 50d) {
        color = TextColor.RED;
    } else if (duration >= 40d) {
        color = TextColor.YELLOW;
    } else {
        color = TextColor.GREEN;
    }

    return TextComponent.of(String.format("%.1f", duration), color);
}
 
Example 6
Source File: HealthModule.java    From spark with GNU General Public License v3.0 5 votes vote down vote up
public static TextComponent formatCpuUsage(double usage) {
    TextColor color;
    if (usage > 0.9) {
        color = TextColor.RED;
    } else if (usage > 0.65) {
        color = TextColor.YELLOW;
    } else {
        color = TextColor.GREEN;
    }

    return TextComponent.of(FormatUtil.percent(usage, 1d), color);
}