Java Code Examples for org.bukkit.ChatColor#DARK_GREEN

The following examples show how to use org.bukkit.ChatColor#DARK_GREEN . 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: ItemInfoCommandExecutor.java    From UhcCore with GNU General Public License v3.0 6 votes vote down vote up
private void sendJsonItemMessage(Player player, ItemStack item){
    String json = JsonItemUtils.getItemJson(item);

    if (json.length() > 100){
        player.sendMessage(ChatColor.GREEN + "Item Json is too big for chat, uploading to paste bin ...");

        String url;
        try{
            url = FileUtils.uploadTextFile(new StringBuilder(json));
        }catch (IOException ex){
            player.sendMessage(ChatColor.RED + "Failed to upload item json to paste bin, check console for more detail.");
            ex.printStackTrace();
            return;
        }

        player.sendMessage(ChatColor.DARK_GREEN + " Json-Item: " + ChatColor.GREEN + url);
        return;
    }

    String text = ChatColor.DARK_GREEN + " Json-Item: " + ChatColor.RESET + json;
    if (UhcCore.isSpigotServer()){
        SpigotUtils.sendMessage(player, text, ChatColor.GREEN + "Click to copy", json, SpigotUtils.Action.SUGGEST);
    }else{
        player.sendMessage(text);
    }
}
 
Example 4
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 5
Source File: CommandHandler.java    From NyaaUtils with MIT License 5 votes vote down vote up
private ChatColor pingColor(double ping) {
    if (ping <= 30) {
        return ChatColor.GREEN;
    } else if (ping <= 60) {
        return ChatColor.DARK_GREEN;
    } else if (ping <= 100) {
        return ChatColor.YELLOW;
    } else if (ping <= 150) {
        return ChatColor.GOLD;
    }
    return ChatColor.RED;
}
 
Example 6
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 7
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 8
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 9
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 10
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 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: CommandHandler.java    From NyaaUtils with MIT License 5 votes vote down vote up
private ChatColor tpsColor(double tps) {
    if (tps >= 19) {
        return ChatColor.GREEN;
    } else if (tps >= 17) {
        return ChatColor.DARK_GREEN;
    } else if (tps >= 15) {
        return ChatColor.YELLOW;
    } else if (tps >= 10) {
        return ChatColor.GOLD;
    }
    return ChatColor.RED;
}
 
Example 13
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 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: 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 16
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 17
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;

    }