本文整理汇总了Java中org.bukkit.ChatColor.DARK_GREEN属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.DARK_GREEN属性的具体用法?Java ChatColor.DARK_GREEN怎么用?Java ChatColor.DARK_GREEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.ChatColor
的用法示例。
在下文中一共展示了ChatColor.DARK_GREEN属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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";
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
}
示例5: formatForAgainst
protected String formatForAgainst(ChatColor neutral) {
return "[" + ChatColor.DARK_GREEN + this.getVotesFor() + " " + ChatColor.DARK_RED + this.getVotesAgainst() + neutral + "]";
}
示例6: 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;
}
示例7: 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()))));
}
}
示例8: update
@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.
*/
if (shouldLearn) {
this.word
.changeWord((String) ifNameIsValid.keySet().toArray()[(int) ((ifNameIsValid
.keySet().size() - 1) * Math.random())]);
}
boolean result = tickAndThink()[0];
if (!shouldLearn) {
return ((result ? ChatColor.DARK_GREEN : ChatColor.DARK_RED) + "|="
+ base.word.getWord() + "| " + result + "|Human-Score " + ((int) (100 * (base.ai
.getNeuronFromId(0).getTriggeredStength()))));
} else {
boolean ishuman = ifNameIsValid.get(base.word.getWord());
this.getAccuracy().addEntry(result == ishuman);
float accuracy = (float) this.getAccuracy().getAccuracy();
wasCorrect = result == ishuman;
// IMPROVE IT
Neuron[] array = new Neuron[1];
if (ishuman)
array[0] = base.ai.getNeuronFromId(0);
DeepReinforcementUtil.instantaneousReinforce(base, array,
(wasCorrect ? 1 : 3));
return ((result == ishuman ? ChatColor.GREEN : ChatColor.RED)
+ "acc " + ((int) (100 * accuracy)) + "|="
+ base.word.getWord() + "| " + result + "|Human-Score " + ((int) (100 * (base.ai
.getNeuronFromId(0).getTriggeredStength()))));
}
}
示例9: execute
@Override
public void execute() {
String message = ChatColor.DARK_GREEN + getEntityName() + ": " + ChatColor.GREEN + this.message;
getPlayers().forEach(p -> p.sendMessage(formatString(message, p)));
getWorld().playSound(getCamera().getLocation(), sound != null ? sound : getDisplay().getTalkSound(), 1F, pitch);
}
示例10: getPrefix
public String getPrefix()
{
return ChatColor.GREEN + "Lotto " + ChatColor.DARK_GREEN + "» " + ChatColor.YELLOW;
}