Java Code Examples for org.bukkit.ChatColor#DARK_RED

The following examples show how to use org.bukkit.ChatColor#DARK_RED . 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: PrimeNumberBot.java    From NeuralNetworkAPI with GNU General Public License v3.0 6 votes vote down vote up
@Override
public String update() {
	boolean[] thought = tickAndThink();
	float accuracy = 0;

	// If it isprime:

	boolean[] booleanBase = new boolean[10];
	for (int i = 0; i < 10; i++) {
		booleanBase[i] = binary.getNumberAt(0, i) != 0;
	}
	int number = binaryBooleansToNumber(booleanBase);
	boolean result = ifNumberIsPrime.get(number);

	return ((thought[0] ? ChatColor.DARK_GREEN : ChatColor.DARK_RED) + "|=" + number + "|WasPrime-Score "
			+ ((int) (100 * (ai.getNeuronFromId(0).getTriggeredStength()))));

}
 
Example 2
Source File: BotGuesser.java    From NeuralNetworkAPI with GNU General Public License v3.0 6 votes vote down vote up
@Override
public String update() {
	/**
	 * 1) If it should learn, select a random entry from the map. Based on the way
	 * we propogate the map, it has a 50% chance of being a valid name.
	 * 
	 * 2) Tick and think.
	 * 
	 * 3) If it is not learning, return if it was correct, the word used, and its
	 * "score".
	 * 
	 * 4) else, check if the name was a real name, and compare if the NN gave the
	 * same answer
	 * 
	 * 5) if it did not, improve it.
	 */
	boolean result = tickAndThink()[0];

	return ((result ? ChatColor.DARK_GREEN : ChatColor.DARK_RED) + "|=" + base.word.getWord() + "|  " + result
			+ "|Human-Score " + ((int) (100 * (base.ai.getNeuronFromId(0).getTriggeredStength()))));

}
 
Example 3
Source File: ScoreboardManager.java    From UhcCore with GNU General Public License v3.0 6 votes vote down vote up
public String getScoreboardLine(int line){
    if (line == 0) return ChatColor.UNDERLINE + "" + ChatColor.RESET;
    if (line == 1) return ChatColor.ITALIC + "" + ChatColor.RESET;
    if (line == 2) return ChatColor.BOLD + "" + ChatColor.RESET;
    if (line == 3) return ChatColor.RESET + "" + ChatColor.RESET;
    if (line == 4) return ChatColor.GREEN + "" + ChatColor.RESET;
    if (line == 5) return ChatColor.DARK_GRAY + "" + ChatColor.RESET;
    if (line == 6) return ChatColor.GOLD + "" + ChatColor.RESET;
    if (line == 7) return ChatColor.RED + "" + ChatColor.RESET;
    if (line == 8) return ChatColor.YELLOW + "" + ChatColor.RESET;
    if (line == 9) return ChatColor.WHITE + "" + ChatColor.RESET;
    if (line == 10) return ChatColor.DARK_GREEN + "" + ChatColor.RESET;
    if (line == 11) return ChatColor.BLUE + "" + ChatColor.RESET;
    if (line == 12) return ChatColor.STRIKETHROUGH + "" + ChatColor.RESET;
    if (line == 13) return ChatColor.MAGIC + "" + ChatColor.RESET;
    if (line == 14) return ChatColor.DARK_RED + "" + ChatColor.RESET;
    return null;
}
 
Example 4
Source File: ScoreboardSlot.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
/**
 * Determines the scoreboard slot value based on an internal Minecraft integer
 * @param i the scoreboard slot value
 */
public ScoreboardSlot(int i) {
	//Initialize displaySlot
	switch(i) {
		case 0: displaySlot = DisplaySlot.PLAYER_LIST; break;
		case 1: displaySlot = DisplaySlot.SIDEBAR; break;
		case 2: displaySlot = DisplaySlot.BELOW_NAME; break;
		default: displaySlot = DisplaySlot.SIDEBAR; break;
	}
	
	//Initialize teamColor
	switch(i) {
		case 3: teamColor = ChatColor.BLACK; break;
		case 4: teamColor = ChatColor.DARK_BLUE; break;
		case 5: teamColor = ChatColor.DARK_GREEN; break;
		case 6: teamColor = ChatColor.DARK_AQUA; break;
		case 7: teamColor = ChatColor.DARK_RED; break;
		case 8: teamColor = ChatColor.DARK_PURPLE; break;
		case 9: teamColor = ChatColor.GOLD; break;
		case 10: teamColor = ChatColor.GRAY; break;
		case 11: teamColor = ChatColor.DARK_GRAY; break;
		case 12: teamColor = ChatColor.BLUE; break;
		case 13: teamColor = ChatColor.GREEN; break;
		case 14: teamColor = ChatColor.AQUA; break;
		case 15: teamColor = ChatColor.RED; break;
		case 16: teamColor = ChatColor.LIGHT_PURPLE; break;
		case 17: teamColor = ChatColor.YELLOW; break;
		case 18: teamColor = ChatColor.WHITE; break;
		default: teamColor = null; break;
	}
}
 
Example 5
Source File: MiscUtil.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static ChatColor convertBannerColorToChatColor(DyeColor dye) {
    switch (dye) {
        case WHITE:
            return ChatColor.WHITE;
        case ORANGE:
            return ChatColor.GOLD;
        case MAGENTA:
            return ChatColor.LIGHT_PURPLE;
        case LIGHT_BLUE:
            return ChatColor.BLUE;
        case YELLOW:
            return ChatColor.YELLOW;
        case LIME:
            return ChatColor.GREEN;
        case PINK:
            return ChatColor.RED;
        case GRAY:
            return ChatColor.DARK_GRAY;
        case SILVER:
            return ChatColor.GRAY;
        case CYAN:
            return ChatColor.DARK_AQUA;
        case PURPLE:
            return ChatColor.DARK_PURPLE;
        case BLUE:
            return ChatColor.BLUE;
        case BROWN:
            return ChatColor.GOLD;
        case GREEN:
            return ChatColor.DARK_GREEN;
        case RED:
            return ChatColor.DARK_RED;
        case BLACK:
            return ChatColor.BLACK;
    }

    return ChatColor.WHITE;
}
 
Example 6
Source File: MiscUtil.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static ChatColor convertDyeColorToChatColor(DyeColor dye) {
    switch (dye) {
        case WHITE:
            return ChatColor.WHITE;
        case ORANGE:
            return ChatColor.GOLD;
        case MAGENTA:
            return ChatColor.LIGHT_PURPLE;
        case LIGHT_BLUE:
            return ChatColor.BLUE;
        case YELLOW:
            return ChatColor.YELLOW;
        case LIME:
            return ChatColor.GREEN;
        case PINK:
            return ChatColor.RED;
        case GRAY:
            return ChatColor.DARK_GRAY;
        case SILVER:
            return ChatColor.GRAY;
        case CYAN:
            return ChatColor.DARK_AQUA;
        case PURPLE:
            return ChatColor.DARK_PURPLE;
        case BLUE:
            return ChatColor.DARK_BLUE;
        case BROWN:
            return ChatColor.GOLD;
        case GREEN:
            return ChatColor.DARK_GREEN;
        case RED:
            return ChatColor.DARK_RED;
        case BLACK:
            return ChatColor.BLACK;
    }

    return ChatColor.WHITE;
}
 
Example 7
Source File: ChatUtil.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static ChatColor getTimerColor(double time) {
    if (time <= 5) {
        return ChatColor.DARK_RED;
    } else if (time <= 30) {
        return ChatColor.GOLD;
    } else if (time <= 60) {
        return ChatColor.YELLOW;
    } else {
        return ChatColor.GREEN;
    }
}
 
Example 8
Source File: Poll.java    From CardinalPGM with MIT License 5 votes vote down vote up
private void end() {
    boolean succeed = votedYes.size() > votedNo.size();
    ChatColor color = succeed ? ChatColor.DARK_GREEN : ChatColor.DARK_RED;
    ChatUtil.getGlobalChannel().sendLocalizedMessage(new UnlocalizedChatMessage(color + "{0}", new LocalizedChatMessage(succeed ? ChatConstant.GENERIC_POLL_SUCCEEDED : ChatConstant.GENERIC_POLL_FAILED, command() + color, result())));
    stop(null);
    if (succeed) Bukkit.dispatchCommand(sender, command);
}
 
Example 9
Source File: HelpProvider.java    From AuthMeReloaded with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Adds help info about the given command's permissions into the provided list.
 *
 * @param command the command to generate permissions info for
 * @param sender the command sender, used to evaluate permissions
 * @param lines the output collection to add the info to
 */
private void addPermissionsInfo(CommandDescription command, CommandSender sender, List<String> lines) {
    PermissionNode permission = command.getPermission();
    if (permission == null) {
        return;
    }
    lines.add(ChatColor.GOLD + helpMessagesService.getMessage(HelpSection.PERMISSIONS) + ":");

    boolean hasPermission = permissionsManager.hasPermission(sender, permission);
    lines.add(String.format(" " + ChatColor.YELLOW + ChatColor.ITALIC + "%s" + ChatColor.GRAY + " (%s)",
        permission.getNode(), getLocalPermissionText(hasPermission)));

    // Addendum to the line to specify whether the sender has permission or not when default is OP_ONLY
    final DefaultPermission defaultPermission = permission.getDefaultPermission();
    String addendum = "";
    if (DefaultPermission.OP_ONLY.equals(defaultPermission)) {
        addendum = " (" + getLocalPermissionText(defaultPermission.evaluate(sender)) + ")";
    }
    lines.add(ChatColor.GOLD + helpMessagesService.getMessage(HelpMessage.DEFAULT) + ": "
        + ChatColor.GRAY + ChatColor.ITALIC + helpMessagesService.getMessage(defaultPermission) + addendum);

    // Evaluate if the sender has permission to the command
    ChatColor permissionColor;
    String permissionText;
    if (permissionsManager.hasPermission(sender, command.getPermission())) {
        permissionColor = ChatColor.GREEN;
        permissionText = getLocalPermissionText(true);
    } else {
        permissionColor = ChatColor.DARK_RED;
        permissionText = getLocalPermissionText(false);
    }
    lines.add(String.format(ChatColor.GOLD + " %s: %s" + ChatColor.ITALIC + "%s",
        helpMessagesService.getMessage(HelpMessage.RESULT), permissionColor, permissionText));
}
 
Example 10
Source File: NumberUtils.java    From Slimefun4 with GNU General Public License v3.0 5 votes vote down vote up
public static ChatColor getColorFromPercentage(float percentage) {
    if (percentage < 16.0F) return ChatColor.DARK_RED;
    else if (percentage < 32.0F) return ChatColor.RED;
    else if (percentage < 48.0F) return ChatColor.GOLD;
    else if (percentage < 64.0F) return ChatColor.YELLOW;
    else if (percentage < 80.0F) return ChatColor.DARK_GREEN;
    else return ChatColor.GREEN;
}
 
Example 11
Source File: TPSCommand.java    From LagMonitor with MIT License 5 votes vote down vote up
private void buildLine(float sampleSecond, List<StringBuilder> graphLines, boolean console) {
    ChatColor color = ChatColor.DARK_RED;
    int lines = 0;
    if (sampleSecond > 19.5F) {
        lines = GRAPH_LINES;
        color = ChatColor.DARK_GREEN;
    } else if (sampleSecond > 18.0F) {
        lines = GRAPH_LINES - 1;
        color = ChatColor.GREEN;
    } else if (sampleSecond > 17.0F) {
        lines = GRAPH_LINES - 2;
        color = ChatColor.YELLOW;
    } else if (sampleSecond > 15.0F) {
        lines = GRAPH_LINES - 3;
        color = ChatColor.GOLD;
    } else if (sampleSecond > 12.0F) {
        lines = GRAPH_LINES - 4;
        color = ChatColor.RED;
    }

    //in y-direction in reverse order
    for (int line = GRAPH_LINES - 1; line >= 0; line--) {
        if (lines == 0) {
            graphLines.get(line).append(ChatColor.WHITE).append(console ? EMPTY_CHAR : PLAYER_EMPTY_CHAR);
            continue;
        }

        lines--;
        graphLines.get(line).append(color).append(console ? GRAPH_CHAR : PLAYER_GRAPH_CHAR);
    }
}
 
Example 12
Source File: TPSCommand.java    From LagMonitor with MIT License 5 votes vote down vote up
private void buildLine(float sampleSecond, List<StringBuilder> graphLines, boolean console) {
    ChatColor color = ChatColor.DARK_RED;
    int lines = 0;
    if (sampleSecond > 19.5F) {
        lines = GRAPH_LINES;
        color = ChatColor.DARK_GREEN;
    } else if (sampleSecond > 18.0F) {
        lines = GRAPH_LINES - 1;
        color = ChatColor.GREEN;
    } else if (sampleSecond > 17.0F) {
        lines = GRAPH_LINES - 2;
        color = ChatColor.YELLOW;
    } else if (sampleSecond > 15.0F) {
        lines = GRAPH_LINES - 3;
        color = ChatColor.GOLD;
    } else if (sampleSecond > 12.0F) {
        lines = GRAPH_LINES - 4;
        color = ChatColor.RED;
    }

    //in y-direction in reverse order
    for (int line = GRAPH_LINES - 1; line >= 0; line--) {
        if (lines == 0) {
            graphLines.get(line).append(ChatColor.WHITE).append(console ? EMPTY_CHAR : PLAYER_EMPTY_CHAR);
            continue;
        }

        lines--;
        graphLines.get(line).append(color).append(console ? GRAPH_CHAR : PLAYER_GRAPH_CHAR);
    }
}
 
Example 13
Source File: NameUtil.java    From Survival-Games with GNU General Public License v3.0 5 votes vote down vote up
public static String stylize(String name, boolean s, boolean r){

		if(SurvivalGames.auth.contains(name) && r){
			name = ChatColor.DARK_RED+name;
		}
		if(SurvivalGames.auth.contains(name) && !r){
			name = ChatColor.DARK_BLUE+name;
		}
		if(s && name.equalsIgnoreCase("Double0negative")){
			name = name.replace("Double0negative", "Double0");
		}
		return name;
	}
 
Example 14
Source File: TPCommand.java    From Transport-Pipes with MIT License 5 votes vote down vote up
@Subcommand("tps")
@CommandPermission("transportpipes.tps")
@Description("Shows some basic information about the plugin and it's runtime")
public void onTPS(CommandSender cs) {

    int tps = threadService.getCurrentTPS();
    int pref_tps = threadService.getPreferredTPS();
    ChatColor tpsColor = ChatColor.DARK_GREEN;
    if (tps <= 1) {
        tpsColor = ChatColor.DARK_RED;
    } else if (tps <= 3) {
        tpsColor = ChatColor.RED;
    } else if (tps <= 4) {
        tpsColor = ChatColor.GOLD;
    } else if (tps <= 5) {
        tpsColor = ChatColor.GREEN;
    }

    cs.sendMessage(MessageUtils.formatColoredMsg("&6TransportPipes &7v" + plugin.getDescription().getVersion()));
    cs.sendMessage(MessageUtils.formatColoredMsg("&6TPS: " + tpsColor + tps + " &6/ &2" + pref_tps));

    synchronized (globalDuctManager.getDucts()) {
        for (World world : Bukkit.getWorlds()) {
            int worldPipes = 0;
            int worldItems = 0;
            Map<BlockLocation, Duct> ductMap = globalDuctManager.getDucts(world);
            for (Duct duct : ductMap.values()) {
                if (duct.getDuctType().getBaseDuctType().is("Pipe")) {
                    Pipe pipe = (Pipe) duct;
                    worldPipes++;
                    worldItems += 0;
                }
            }
            cs.sendMessage(MessageUtils.formatColoredMsg("&6" + world.getName() + ": &e" + worldPipes + " &6" + "pipes, &e" + worldItems + " &6items"));
        }
    }
}
 
Example 15
Source File: PickerMatchModule.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
private String getWindowTitle(MatchPlayer player) {
  checkState(hasTeams || hasClasses); // Window should not open if there is nothing to pick

  String key;
  if (hasTeams && hasClasses) {
    key = "picker.windowTitle.teamClass";
  } else if (hasTeams) {
    key = "picker.windowTitle.team";
  } else {
    key = "picker.windowTitle.class";
  }

  return ChatColor.DARK_RED + TextTranslations.translate(key, player.getBukkit());
}
 
Example 16
Source File: CycleTimer.java    From CardinalPGM with MIT License 4 votes vote down vote up
@Override
public ChatMessage getBossbarMessage() {
    return new UnlocalizedChatMessage(ChatColor.DARK_AQUA + "{0}", new LocalizedChatMessage(ChatConstant.UI_CYCLING_TIMER,
            new UnlocalizedChatMessage(ChatColor.AQUA + GameHandler.getGameHandler().getCycle().getMap().getName() + ChatColor.DARK_AQUA),
            new LocalizedChatMessage(getTime() == 1 ? ChatConstant.UI_SECOND : ChatConstant.UI_SECONDS, ChatColor.DARK_RED + "" + getTime() + ChatColor.DARK_AQUA)));
}
 
Example 17
Source File: StartTimer.java    From CardinalPGM with MIT License 4 votes vote down vote up
@Override
public ChatMessage getBossbarMessage() {
    return new UnlocalizedChatMessage(ChatColor.GREEN + "{0}", new LocalizedChatMessage(ChatConstant.UI_MATCH_STARTING_IN, new LocalizedChatMessage(getTime() == 1 ? ChatConstant.UI_SECOND : ChatConstant.UI_SECONDS, ChatColor.DARK_RED + "" + getTime() + ChatColor.GREEN)));
}
 
Example 18
Source File: Poll.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
protected String formatForAgainst(ChatColor neutral) {
    return "[" + ChatColor.DARK_GREEN + this.getVotesFor() + " " + ChatColor.DARK_RED + this.getVotesAgainst() + neutral + "]";
}
 
Example 19
Source File: Poll.java    From CardinalPGM with MIT License 4 votes vote down vote up
private String result() {
    return ChatColor.YELLOW + "[" + ChatColor.DARK_GREEN + votedYes.size() + " " + ChatColor.DARK_RED + votedNo.size() + ChatColor.YELLOW + "]";
}
 
Example 20
Source File: HealthDisplay.java    From EliteMobs with GNU General Public License v3.0 3 votes vote down vote up
private static ChatColor setHealthColor(int currentHealth, int maxHealth) {

        double healthPercentage = currentHealth * 100 / maxHealth;

        if (healthPercentage > 75) {

            return ChatColor.DARK_GREEN;

        }

        if (healthPercentage > 50) {

            return ChatColor.GREEN;

        }

        if (healthPercentage > 25) {

            return ChatColor.RED;

        }

        if (healthPercentage > 0) {

            return ChatColor.DARK_RED;

        }

        return ChatColor.DARK_RED;

    }