本文整理汇总了Java中org.bukkit.ChatColor.MAGIC属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.MAGIC属性的具体用法?Java ChatColor.MAGIC怎么用?Java ChatColor.MAGIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.ChatColor
的用法示例。
在下文中一共展示了ChatColor.MAGIC属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRandomColor
public ChatColor getRandomColor(){
ChatColor c = getRandomChatColor();
if(c == ChatColor.MAGIC || c == ChatColor.STRIKETHROUGH || c == ChatColor.BOLD || c == ChatColor.ITALIC) getRandomColor();
return c;
}
示例2: display
@Override
public void display(Player player)
{
this.inventory = this.hub.getServer().createInventory(null, 45, "Menu Principal");
this.setSlotData(ChatColor.GOLD + "Zone " + ChatColor.GREEN + "VIP", Material.DIAMOND, 9, makeButtonLore(new String[] { "Testez les jeux avant tout le monde !" }, false, true), "beta_vip");
this.setSlotData(ChatColor.GOLD + "Spawn", Material.BED, 18, makeButtonLore(new String[] { "Retournez au spawn grâce à la magie", "de la téléportation céleste !" }, false, true), "spawn");
this.setSlotData(ChatColor.GOLD + "Parcours du ciel", Material.PACKED_ICE, 26, makeButtonLore(new String[] { "En espérant que vous atteignez le", "paradis..."}, false, true), "parkour");
this.setSlotData(ChatColor.GOLD + "Informations", Material.EMPTY_MAP, 27, getInformationLore(), "none");
this.setSlotData(ChatColor.GOLD + "Changer de hub", Material.ENDER_CHEST, 35, makeButtonLore(new String[] { "Cliquez pour ouvrir l'interface" }, true, false), "switch_hub");
for (String gameIdentifier : this.hub.getGameManager().getGames().keySet())
{
AbstractGame game = this.hub.getGameManager().getGameByIdentifier(gameIdentifier);
if (game.getSlotInMainMenu() >= 0)
{
String prefix;
switch (game.getState())
{
case NEW:
prefix = ChatColor.GREEN + "" + ChatColor.BOLD + "NOUVEAU !";
break;
case POPULAR:
prefix = ChatColor.YELLOW + "" + ChatColor.BOLD + "POPULAIRE !";
break;
case SOON:
prefix = ChatColor.RED + "" + ChatColor.BOLD + "BIENTOT !";
break;
case LOCKED:
prefix = ChatColor.GOLD + "" + ChatColor.MAGIC + "aaaaaaaa";
break;
default:
prefix = "";
break;
}
if (!prefix.equals(""))
prefix += " ";
boolean glow = game.getState() == AbstractGame.State.NEW || game.getState() == AbstractGame.State.POPULAR;
this.setSlotData(prefix + ChatColor.GOLD + game.getName(), ItemUtils.hideAllAttributes(game.getState() == AbstractGame.State.LOCKED ? new ItemStack(Material.IRON_FENCE, 1) : (glow ? GlowEffect.addGlow(game.getIcon()) : game.getIcon())), game.getSlotInMainMenu(), makeGameLore(game), "game_" + gameIdentifier);
}
}
this.hub.getServer().getScheduler().runTask(this.hub, () -> player.openInventory(this.inventory));
}
示例3: getRandomColor
public ChatColor getRandomColor(){
ChatColor c = getRandomChatColor();
if(c == ChatColor.MAGIC || c == ChatColor.STRIKETHROUGH || c == ChatColor.BOLD || c == ChatColor.ITALIC) return getRandomColor();
return c;
}