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


Java ChatColor.GREEN属性代码示例

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


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

示例1: 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

示例2: getColor

public static Color getColor(ChatColor color) {
    if (color == ChatColor.RED) {
        return Color.RED;
    } else if (color == ChatColor.BLUE) {
        return Color.BLUE;
    } else if (color == ChatColor.LIGHT_PURPLE) {
        return Color.FUCHSIA;
    } else if (color == ChatColor.GREEN) {
        return Color.GREEN;
    } else if (color == ChatColor.YELLOW) {
        return Color.YELLOW;
    } else if (color == ChatColor.GOLD) {
        return Color.ORANGE;
    } else if (color == ChatColor.AQUA) {
        return Color.AQUA;
    } else if (color == ChatColor.DARK_PURPLE) {
        return Color.PURPLE;
    } else {
        return Color.WHITE;
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:21,代码来源:ColorConverter.java

示例3: setup

public static void setup(Player player) {
	Inventory inv = Bukkit.createInventory(player, Convert.getInventorySize(plugin.getChallengesFile().getChallengesAmount()), ChatColor.BOLD + "Challenges");
	String status = ChatColor.GREEN + " [COMPLETED]";
	int level = plugin.getPlayerManager().getRank(player);
	int prestige = plugin.getPlayerManager().getPrestige(player);
	for(int i = 1; i <= plugin.getChallengesFile().getChallengesAmount(); i++) {
		if(level + 1 == i)
			status = ChatColor.YELLOW + " [CURRENT]";
		else if(i > level)
			status = ChatColor.RED + " [LOCKED]";
		inv.addItem(ItemStackGenerator.createItem(plugin.getChallengesFile().getTypeMaterial(i), 0, 0, ChatColor.GOLD + "" + i + Convert.getOrdinalFor(i) + " challenge" + status,
				Arrays.asList(ChatColor.GRAY + "Type: " + ChatColor.RED + WordUtils.capitalize(plugin.getChallengesFile().getType(i)),
						ChatColor.GRAY + "Cost: " + Convert.toPrice(plugin.getChallengesFile().getPrice(i) * (prestige + 1), true)), true));
	}
	player.openInventory(inv);
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:16,代码来源:ChallengesMenu.java

示例4: 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

示例5: getChatColor

public static ChatColor getChatColor(Color color) {
    if (color == Color.RED) {
        return ChatColor.RED;
    } else if (color == Color.BLUE) {
        return ChatColor.BLUE;
    } else if (color == Color.PURPLE) {
        return ChatColor.DARK_PURPLE;
    } else if (color == Color.GREEN) {
        return ChatColor.GREEN;
    } else if (color == Color.YELLOW) {
        return ChatColor.YELLOW;
    } else {
        return ChatColor.WHITE;
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:15,代码来源:ColorConverter.java

示例6: 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

示例7: getPrefixColorByHealth

/**
 * Get a color according the health
 *
 * @param health Health
 * @param max Health max
 *
 * @return A color
 */
protected static ChatColor getPrefixColorByHealth(double health, double max)
{
    double q = max / 4;

    if (health < q)
        return ChatColor.RED;
    else if (health < (q * 2))
        return ChatColor.YELLOW;
    else if (health < (q * 3))
        return ChatColor.GREEN;
    else
        return ChatColor.DARK_GREEN;
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:21,代码来源:SurvivalGameLoop.java

示例8: createDamageEvent

@Override
public void createDamageEvent()
{
    this.nextEvent = new TimedEvent(1, 0, "Dégats actifs", ChatColor.GREEN, false, () ->
    {
        this.game.getCoherenceMachine().getMessageManager().writeCustomMessage("Les dégats sont désormais actifs.", true);
        this.game.getCoherenceMachine().getMessageManager().writeCustomMessage("Le map sera réduite dans 9 minutes. Le PvP sera activé à ce moment là.", true);
        this.game.enableDamages();
        this.createTeleportationEvent();
        this.blocksProtected = false;
    });
}
 
开发者ID:SamaGames,项目名称:DoubleRunner,代码行数:12,代码来源:DoubleRunnerGameLoop.java

示例9: getDtrColour

public ChatColor getDtrColour() {
    this.updateDeathsUntilRaidable();
    if (deathsUntilRaidable < 0) {
        return ChatColor.RED;
    } else if (deathsUntilRaidable < 1) {
        return ChatColor.YELLOW;
    } else {
        return ChatColor.GREEN;
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:PlayerFaction.java

示例10: getFormattedUnlockedPieces

private String getFormattedUnlockedPieces(Player player)
{
    int unlocked = 0;

    for (ClothCosmetic clothCosmetic : this.set)
        if (clothCosmetic.isOwned(player))
            unlocked++;

    if (unlocked == 0)
        return ChatColor.RED + "0/4";
    else if (unlocked == 4)
        return ChatColor.GREEN + "4/4";
    else
        return ChatColor.YELLOW + "" + unlocked + "/4";
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:15,代码来源:ClothingSet.java

示例11: getPromptText

@Override
public String getPromptText(ConversationContext context) {
    return ChatColor.YELLOW + "Are you sure you want to do this? The server will be in EOTW mode, If EOTW mode is active, all claims whilst making Spawn a KOTH. " + "You will still have "
            + EotwHandler.EOTW_WARMUP_WAIT_SECONDS + " seconds to cancel this using the same command though. " + "Type " + ChatColor.GREEN + "yes" + ChatColor.YELLOW + " to confirm or "
            + ChatColor.RED + "no" + ChatColor.YELLOW + " to deny.";
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:6,代码来源:EotwCommand.java

示例12: update

@Override
public String update() {
	/**
	 * Simple explanation of these steps:
	 * 
	 * 1) If it is currently learning, change the inputs to either true or false.
	 * 
	 * 2) Let the NN tick and think. This will return the outputs from the OutpuitNeurons
	 * 
	 * 3) If it is not learning, just return the answer.
	 * 
	 * 4) Else, do the logic and see if the answer it gave (thought[0]) was correct.
	 * 
	 * 5) If it was not correct, use the DeepReinforcementUtil to improve it.
	 * 
	 * 6) After inprovement, return a message with if it was correct, the accuracy, the inputs, and what it thought was the output,
	 */
	if (shouldLearn) {
		binary.changeValueAt(0, 0,
				ThreadLocalRandom.current().nextBoolean());
		binary.changeValueAt(0, 1,
				ThreadLocalRandom.current().nextBoolean());
	}


	boolean[] thought = tickAndThink();

	if (!shouldLearn) 
		return ("|" + binary.getBooleanAt(0, 0) + " + "
				+ binary.getBooleanAt(0, 1) + " ~~ " + thought[0]);
		boolean logic = !(binary.getBooleanAt(0, 0) || binary.getBooleanAt(
				0, 1));
		boolean result = logic == thought[0];
		this.getAccuracy().addEntry(result);

		// IMPROVE IT
		HashMap<Neuron, Double> map = new HashMap<>();
		for (int i = 0; i < thought.length; i++) 
			map.put(ai.getNeuronFromId(i), logic ? 1 : -1.0);
		if (!result)
			DeepReinforcementUtil.instantaneousReinforce(this, map, 1);
		return ((result ? ChatColor.GREEN : ChatColor.RED) + "acc "
				+ getAccuracy().getAccuracyAsInt() + "|"
				+ binary.getBooleanAt(0, 0) + " + "
				+ binary.getBooleanAt(0, 1) + " ~~ " + thought[0]);
	
}
 
开发者ID:ZombieStriker,项目名称:NeuralNetworkAPI,代码行数:47,代码来源:LogicalNOR.java

示例13: 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

示例14: teamJoin

public static String teamJoin(String team){
    return prefix + ChatColor.GREEN + "Se te ha asignado a " + ChatColor.YELLOW + team;
}
 
开发者ID:cadox8,项目名称:WC,代码行数:3,代码来源:Messages.java

示例15: locationSet

public static String locationSet(String team){
    return prefix + ChatColor.GREEN + "Localización puesta para " + ChatColor.YELLOW + team;
}
 
开发者ID:cadox8,项目名称:WC,代码行数:3,代码来源:Messages.java


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