当前位置: 首页>>代码示例>>Java>>正文


Java ChatColor.DARK_RED属性代码示例

本文整理汇总了Java中org.bukkit.ChatColor.DARK_RED属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.DARK_RED属性的具体用法?Java ChatColor.DARK_RED怎么用?Java ChatColor.DARK_RED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.ChatColor的用法示例。


在下文中一共展示了ChatColor.DARK_RED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: provideLore

private String[] provideLore(Player player, String... permissions) {
    if (permissions != null && permissions.length == 1 && permissions[0] != null) {
        if (permissions.length == 1 && permissions[0].equals("minecraft-heads")) {
            return new String[]{ChatColor.GRAY + "Use exclusive pet heads as costume.", ChatColor.YELLOW + "Sponsored by Minecraft-Heads.com"};
        }
        if (permissions.length == 1 && permissions[0].equals("head-database")) {
            final Plugin plugin = Bukkit.getPluginManager().getPlugin("HeadDatabase");
            if (plugin == null) {
                return new String[]{ChatColor.DARK_RED + "" + ChatColor.ITALIC + "Plugin is not installed - " + ChatColor.YELLOW + "Click me!"};
            }
        }
    }
    final String[] modifiedLore = new String[this.lore.length];
    for (int i = 0; i < modifiedLore.length; i++) {
        modifiedLore[i] = this.lore[i];
        if (this.lore[i].contains("<permission>")) {
            if (permissions != null && (permissions.length == 0 || this.hasPermission(player, permissions))) {
                modifiedLore[i] = this.lore[i].replace("<permission>", Config.getInstance().getPermissionIconYes());
            } else {
                modifiedLore[i] = this.lore[i].replace("<permission>", Config.getInstance().getPermissionIconNo());
            }
        }
    }
    return modifiedLore;
}
 
开发者ID:Shynixn,项目名称:PetBlocks,代码行数:25,代码来源:ItemContainer.java

示例2: KingdomString

private String KingdomString(Kingdom k) {
	switch (k.getType()) {
	case ADAMANTIUM:
		return ChatColor.DARK_RED + "A" + ChatColor.DARK_GRAY + "damantium";
	case DOK:
		return ChatColor.DARK_PURPLE + "Dok";
	case EREDON:
		return ChatColor.AQUA + "Eredon";
	case GEEN:
		break;
	case HYVAR:
		return ChatColor.GOLD + "Hyvar";
	case MALZAN:
		return ChatColor.YELLOW + "Malzan";
	case TILIFIA:
		return ChatColor.DARK_GREEN + "Tilifia";
	default:
		break;

	}
	return "Er ging iets fout";
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:22,代码来源:KingdomMenu.java

示例3: send

/**
 * Requires Spigot API!
 *
 * Sends the relation request to the object faction
 */
public void send() {
    String command = "/factionsxl relation " + object.getName() + " " + subject.getName() + " " + relation.toString();
    ClickEvent onClickConfirm = new ClickEvent(ClickEvent.Action.RUN_COMMAND, command);
    TextComponent confirm = new TextComponent(ChatColor.GREEN + FMessage.MISC_ACCEPT.getMessage());
    confirm.setClickEvent(onClickConfirm);

    ClickEvent onClickDeny = new ClickEvent(ClickEvent.Action.RUN_COMMAND, command + " -deny");
    TextComponent deny = new TextComponent(ChatColor.DARK_RED + FMessage.MISC_DENY.getMessage());
    deny.setClickEvent(onClickDeny);

    object.sendMessage(FMessage.RELATION_WISH.getMessage(), subject, relation.getName());// TODO getFormatted()
    for (Player player : object.getOnlineMods()) {
        player.spigot().sendMessage(confirm, new TextComponent(" "), deny);
    }
    if (object.getAdmin().isOnline()) {
        object.getAdmin().getPlayer().spigot().sendMessage(confirm, new TextComponent(" "), deny);
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:23,代码来源:Relation.java

示例4: onPlayerChat

@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent ev)
{
    if (ev.isCancelled())
        return ;
    ev.setCancelled(true);
    CPlayer cplayer = AgarMC.get().getGame().getCPlayer(ev.getPlayer());
    if (cplayer == null)
        return ;
    String msg = "";
    if (AgarMC.get().getGame().getGameType() == GameType.TEAMS)
    {
        TeamColor team = TeamColor.getTeam(cplayer.getColor());
        msg += ChatColor.DARK_GRAY + "[" + (team == null ? ChatColor.DARK_RED + "ERROR" : team.getDisplayName()) + ChatColor.DARK_GRAY + "]";
    }
    if (cplayer.isPlaying())
        msg += ChatColor.DARK_GRAY + "[" + ChatColor.GREEN + cplayer.getTotalMass() + ChatColor.DARK_GRAY + "]";
    if (!msg.isEmpty())
        msg += " ";
    msg += ChatColor.GRAY + ev.getPlayer().getName() + ChatColor.WHITE + ": " + ev.getMessage();
    for (Player p : Bukkit.getOnlinePlayers())
        p.sendMessage(msg);
    Bukkit.getConsoleSender().sendMessage(msg);
}
 
开发者ID:SamaGames,项目名称:AgarMC,代码行数:24,代码来源:PlayerListener.java

示例5: convertDyeColorToChatColor

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;
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:38,代码来源:ColorConverter.java

示例6: getStabilityModifiers

/**
 * @return
 * the stability value with all modifiers as hover texts
 */
public BaseComponent[] getStabilityModifiers(ChatColor c) {
    String stability = FMessage.CMD_SHOW_STABILITY.getMessage() + c + getStability();
    String base = FMessage.CMD_SHOW_STABILITY_MOD_BASE.getMessage() + color(this.stability) + "\n";
    String exhaustion = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_EXHAUSTION.getMessage() + color((int) (this.exhaustion * this.exhaustion)) + "\n";
    String size = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_PROVINCES.getMessage() + color((regions.size() - 1 * regions.size() - 1) / 2) + "\n";
    String adminNotMember = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_ABSENT_MONARCH.getMessage() + color(members.contains(admin) ? 0 : -25) + "\n";
    String power = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_POWER.getMessage();
    if (getPower() > chunks.size()) {
        power += ChatColor.GREEN + "+10";
    } else if (getPower() < chunks.size()) {
        power += ChatColor.DARK_RED + "-10";
    } else {
        power += ChatColor.YELLOW + "0";
    }
    power += "\n";
    int i = 0;
    for (ResourceSubcategory category : ResourceSubcategory.values()) {
        i += isSubcategorySaturated(category).getStabilityBonus();
    }
    String wealth = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_WEALTH.getMessage() + color(i);

    BaseComponent[] msg = TextComponent.fromLegacyText(stability);
    for (BaseComponent component : msg) {
        component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(base + exhaustion + size + adminNotMember + power + wealth)));
    }
    return msg;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:31,代码来源:Faction.java

示例7: color

private String color(int i) {
    if (i > 0) {
        return ChatColor.GREEN + "+" + String.valueOf(i);
    } else if (i < 0) {
        return ChatColor.DARK_RED + String.valueOf(i);
    } else {
        return ChatColor.YELLOW + String.valueOf(i);
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:9,代码来源:Faction.java

示例8: sendInvitation

/**
 * Requires Spigot API!
 *
 * Sends an invitation to join this faction to the player.
 *
 * @param player
 * the player that will receive the invitation
 */
public void sendInvitation(Player player) {
    ClickEvent onClickConfirm = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/factionsxl join " + name);
    TextComponent confirm = new TextComponent(ChatColor.GREEN + FMessage.MISC_ACCEPT.getMessage());
    confirm.setClickEvent(onClickConfirm);

    ClickEvent onClickDeny = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/factionsxl join " + name + " deny");
    TextComponent deny = new TextComponent(ChatColor.DARK_RED + FMessage.MISC_DENY.getMessage());
    deny.setClickEvent(onClickDeny);

    ParsingUtil.sendMessage(player, FMessage.FACTION_INVITE.getMessage(name));
    player.spigot().sendMessage(confirm, new TextComponent(" "), deny);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:20,代码来源:Faction.java

示例9: send

public void send() {
    Faction receiver = null;
    if (!importerAccepted) {
        receiver = importer;
        importer.sendMessage(FMessage.TRADE_OFFER_SEND_TRADE.getMessage(), exporter);
        importer.sendMessage(FMessage.TRADE_OFFER_SEND_EXPORT.getMessage(), amount + " " + good.getName(), econ.format(price));
    } else if (!exporterAccepted) {
        receiver = exporter;
        exporter.sendMessage(FMessage.TRADE_OFFER_SEND_TRADE.getMessage(), importer);
        exporter.sendMessage(FMessage.TRADE_OFFER_SEND_IMPORT.getMessage(), amount + " " + good.getName(), econ.format(price));
    }

    String command = "/factionsxl tradeOffer " + (FactionsXL.getInstance().getCommandCache().tradeOffer.finishedOffers.size() - 1);
    ClickEvent onClickConfirm = new ClickEvent(ClickEvent.Action.RUN_COMMAND, command);
    TextComponent confirm = new TextComponent(ChatColor.GREEN + FMessage.MISC_ACCEPT.getMessage());
    confirm.setClickEvent(onClickConfirm);

    ClickEvent onClickDeny = new ClickEvent(ClickEvent.Action.RUN_COMMAND, command + " -deny");
    TextComponent deny = new TextComponent(ChatColor.DARK_RED + FMessage.MISC_DENY.getMessage());
    deny.setClickEvent(onClickDeny);

    for (Player player : receiver.getOnlineMods()) {
        player.spigot().sendMessage(confirm, new TextComponent(" "), deny);
    }
    if (receiver.getAdmin().isOnline()) {
        receiver.getAdmin().getPlayer().spigot().sendMessage(confirm, new TextComponent(" "), deny);
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:28,代码来源:TradeOffer.java

示例10: getDisplayName

private String getDisplayName(final Entity entity) {
    Preconditions.checkNotNull((Object) entity,  "Entity cannot be null");
    if(entity instanceof Player) {
        final Player player = (Player) entity;
        return player.getName() + ChatColor.DARK_RED + '[' + ChatColor.DARK_RED + this.plugin.getUserManager().getUser(player.getUniqueId()).getKills() + ChatColor.DARK_RED + ']';
    }
    return WordUtils.capitalizeFully(entity.getType().name().replace('_', ' '));
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:8,代码来源:DeathMessageListener.java

示例11: stringToChatColor

public static ChatColor stringToChatColor(String str) {
	switch(str.toLowerCase()) {
		case "aqua":
			return ChatColor.AQUA;
		case "black":
			return ChatColor.BLACK;
		case "blue":
			return ChatColor.BLUE;
		case "dark_blue":
			return ChatColor.DARK_BLUE;
		case "dark_gray":
			return ChatColor.DARK_GRAY;
		case "dark_green":
			return ChatColor.DARK_GREEN;
		case "dark_purple":
			return ChatColor.DARK_PURPLE;
		case "dark_red":
			return ChatColor.DARK_RED;
		case "gold":
			return ChatColor.GOLD;
		case "gray":
			return ChatColor.GRAY;
		case "green":
			return ChatColor.GREEN;
		case "light_puple":
			return ChatColor.LIGHT_PURPLE;
		case "white":
			return ChatColor.WHITE;
		case "yellow":
			return ChatColor.YELLOW;
		default:
			return ChatColor.RED;
	}
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:34,代码来源:Convert.java

示例12: formatForAgainst

protected String formatForAgainst(ChatColor neutral) {
    return "[" + ChatColor.DARK_GREEN + this.getVotesFor() + " " + ChatColor.DARK_RED + this.getVotesAgainst() + neutral + "]";
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:3,代码来源:Poll.java

示例13: getName

@Override
public String getName() {
	return ChatColor.GRAY + "[" + ChatColor.DARK_RED + "Owner" + ChatColor.GRAY + "]";
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:4,代码来源:OwnerChannelRank.java

示例14: onCommand

@Override
public boolean onCommand(CommandSender cs, String[] args) {
	if (!cs.hasPermission("transportpipes.tps")) {
		return false;
	}
	int tps = TransportPipes.instance.pipeThread.getCalculatedTps();
	ChatColor colour = ChatColor.DARK_GREEN;
	if (tps <= 1) {
		colour = ChatColor.DARK_RED;
	} else if (tps <= 3) {
		colour = ChatColor.RED;
	} else if (tps <= 4) {
		colour = ChatColor.GOLD;
	} else if (tps <= 5) {
		colour = ChatColor.GREEN;
	}

	float lastTickDiff = TransportPipes.instance.pipeThread.getLastTickDiff() / 1000f;

	cs.sendMessage(String.format(LocConf.load(LocConf.COMMANDS_HEADER), TransportPipes.instance.getDescription().getVersion()));
	cs.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6Tick duration: " + colour + (TransportPipes.instance.pipeThread.timeTick / 10000) / 100f + "ms"));
	cs.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6Last Tick: " + lastTickDiff));
	cs.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6TPS: " + colour + tps + " &6/ §2" + PipeThread.WANTED_TPS));

	for (World world : Bukkit.getWorlds()) {
		int worldPipes = 0;
		int worldItems = 0;
		Map<BlockLoc, Duct> ductMap = TransportPipes.instance.getDuctMap(world);
		if (ductMap != null) {
			synchronized (ductMap) {
				for (Duct duct : ductMap.values()) {
					if (duct.getDuctType() == DuctType.PIPE) {
						Pipe pipe = (Pipe) duct;
						worldPipes++;
						worldItems += pipe.pipeItems.size() + pipe.tempPipeItems.size() + pipe.tempPipeItemsWithSpawn.size();
					}
				}
			}
			cs.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6" + world.getName() + ": &e" + worldPipes + " &6" + "pipes, &e" + worldItems + " &6items"));
		}
	}

	/*
	 * cs.sendMessage("Timings:"); for (String timing :
	 * TimingCloseable.timings.keySet()) { long time =
	 * TimingCloseable.timings.get(timing); long maxTime =
	 * TimingCloseable.timingsRecord.get(timing); String timeS =
	 * String.format("%.3f", time / 1000000f); String maxTimeS =
	 * String.format("%.3f", maxTime / 1000000f); long amount =
	 * TimingCloseable.timingsAmount.get(timing); cs.sendMessage(timing + ": §6" +
	 * timeS + "§r millis (Max: §6" + maxTimeS + "§r, " + amount + " times)"); }
	 */

	cs.sendMessage(LocConf.load(LocConf.COMMANDS_FOOTER));

	return true;

}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:58,代码来源:TPSCommandExecutor.java

示例15: update

@Override
public String update() {		
	if (shouldLearn) {
		boolean[] bbb = numberToBinaryBooleans((lastNumber++%1023)/*(int) (Math.random() * 1023)*/);
		for (int i = 0; i < bbb.length; i++) {
			binary.changeNumberAt(0, i, (bbb[i]) ? 1 : 0);
			binary.changeNumberAt(1, i, (bbb[i]) ? 0 : 1);
		}
	}
	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);

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

	} else {
		wasCorrect = (result == thought[0]);

		this.getAccuracy().addEntry(wasCorrect);
		accuracy = (float) this.getAccuracy().getAccuracy();

		// IMPROVE IT
		HashMap<Neuron, Double> map = new HashMap<>();
		map.put(ai.getNeuronFromId(0), result ? 1 : -1.0);
		if (!wasCorrect)
			DeepReinforcementUtil.instantaneousReinforce(this, map, 1);
		return ((wasCorrect ? ChatColor.GREEN : ChatColor.RED) + "acc "
				+ ((int) (100 * accuracy)) + "|=" + number + "|correctResp=" + result
				+ "|WasPrime-Score " + ((int) (100 * (ai.getNeuronFromId(0)
				.getTriggeredStength()))));
	}
}
 
开发者ID:ZombieStriker,项目名称:NeuralNetworkAPI,代码行数:43,代码来源:PrimeNumberBot.java


注:本文中的org.bukkit.ChatColor.DARK_RED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。