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


Java ChatColor.GOLD属性代码示例

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


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

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

示例2: onFactionChat

@EventHandler(ignoreCancelled=true, priority=EventPriority.MONITOR)
public void onFactionChat(FactionChatEvent event)
{
  Player player = event.getPlayer();
  Faction faction = event.getFaction();
  String format = ChatColor.GOLD + "[" + ChatColor.RED + event.getChatChannel().getDisplayName() + ": " + ChatColor.YELLOW + faction.getName() + ChatColor.GOLD + "] " + ChatColor.GRAY + event.getFactionMember().getRole().getAstrix() + player.getName() + ": " + ChatColor.YELLOW + event.getMessage();
  HashSet<Player> recipients = new HashSet();
  recipients.removeAll(event.getRecipients());
  for (CommandSender recipient : recipients) {
    if ((recipient instanceof Player))
    {
      Player target = (Player)recipient;
      FactionUser user = event.isAsynchronous() ? this.plugin.getUserManager().getUserAsync(target.getUniqueId()) : this.plugin.getUserManager().getUser(player.getUniqueId());
      Collection<UUID> spying = user.getFactionChatSpying();
      if ((spying.contains(ALL_UUID)) || (spying.contains(faction.getUniqueID()))) {
        recipient.sendMessage(format);
      }
    }
  }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:20,代码来源:FactionChatSpyArgument.java

示例3: MultipleCommandAliasHelpTopic

public MultipleCommandAliasHelpTopic(MultipleCommandAlias alias) {
    this.alias = alias;

    name = "/" + alias.getLabel();

    // Build short text
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < alias.getCommands().length; i++) {
        if (i != 0) {
            sb.append(ChatColor.GOLD + " > " + ChatColor.WHITE);
        }
        sb.append("/");
        sb.append(alias.getCommands()[i].getLabel());
    }
    shortText = sb.toString();

    // Build full text
    fullText = ChatColor.GOLD + "Alias for: " + ChatColor.WHITE + getShortText();
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:19,代码来源:MultipleCommandAliasHelpTopic.java

示例4: execute

@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args)
{
    if ( !testPermission( sender ) )
    {
        return true;
    }

    StringBuilder sb = new StringBuilder( ChatColor.GOLD + "TPS from last 1m, 5m, 15m: " );
    for ( double tps : net.minecraft.server.MinecraftServer.getServer().recentTps )
    {
        sb.append( format( tps ) );
        sb.append( ", " );
    }
    sender.sendMessage( sb.substring( 0, sb.length() - 2 ) );

    return true;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:18,代码来源:TicksPerSecondCommand.java

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

示例6: onLogin

public void onLogin(Player player)
{
    if (this.holograms.containsKey(player.getUniqueId()))
        this.onLogout(player);

    int fishes = 0;

    for (Bonus bonus : this.hub.getInteractionManager().getMeowManager().getBonus())
        if (bonus.isAbleFor(player))
            fishes++;

    Hologram hologram;

    if (fishes > 0)
        hologram = new Hologram(MEOW_NAME, ChatColor.GOLD + "" + fishes + ChatColor.YELLOW + " poisson" + (fishes > 1 ? "s" : "") + " disponible" + (fishes > 1 ? "s" : ""));
    else
        hologram = new Hologram(MEOW_NAME);

    hologram.generateLines(this.meowEntity.getBukkitEntity().getLocation().clone().add(0.0D, 0.75D, 0.0D));
    hologram.addReceiver(player);

    this.holograms.put(player.getUniqueId(), hologram);
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:23,代码来源:Meow.java

示例7: skipSong

public String skipSong(boolean becauseMehs)
{
    if (this.currentPlaylist != null && this.currentPlaylist.getPlayer().isPlaying())
    {
        if (becauseMehs)
            this.hub.getServer().broadcastMessage(JUKEBOX_TAG + ChatColor.RED + "La musique est passée car elle a reçu plus de 33% de votes négatifs.");

        this.currentPlaylist.getPlayer().setPlaying(false);

        if (this.nextSong())
            return JUKEBOX_TAG + ChatColor.GREEN + "Musique suivante jouée.";
        else
            return JUKEBOX_TAG + ChatColor.GOLD + "La musique a été arrêtée mais la playlist est vide.";
    }
    else
    {
        return JUKEBOX_TAG + ChatColor.RED + "Aucun son n'est lu actuellement.";
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:19,代码来源:JukeboxManager.java

示例8: getKnowledgeMain

public Menu getKnowledgeMain() {
	Menu m = new Menu(ChatColor.GOLD + "Book of Knowledge", 45);
	Button crafting = new Button(new ItemConstruct(Material.WORKBENCH).getMeta().setName("Recipes").getItem()) {
		
		@Override
		public void onClick(Player p, Inventory i) {
			p.openInventory(getCraftMainMenu().inv);
		}
		
	};
	m.addButton(crafting);
	m.addItem(crafting.getItem());
	Registry.registerListener(m);
	return m;
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:15,代码来源:CustomCrafting.java

示例9: getCoinsItemTitle

private String getCoinsItemTitle()
{
    if (SamaGamesAPI.get().getSettingsManager().getSettings(this.uuid).isAllowCoinsOnClick())
        return ChatColor.GOLD + String.valueOf(SamaGamesAPI.get().getPlayerManager().getPlayerData(this.uuid).getCoins()) + " pièces";
    else
        return ChatColor.RED + "Cette information est privée !";
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:7,代码来源:GuiClickMe.java

示例10: onCommand

public void onCommand(CommandSender sender, String[] args) throws CommandException {
    StringBuilder builder = new StringBuilder(ChatColor.GOLD + "Ladder(s): " + ChatColor.GRAY);

    ManagerHandler.getLadderManager().getLadders().values().forEach(ladder -> {
        builder.append(ladder.getName() + ChatColor.GRAY + ", ");
    });

    sender.sendMessage(builder.toString());
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:9,代码来源:LadderListArgument.java

示例11: ShowHunger

public static List<String> ShowHunger(Player player)
{
	int hunger = player.getFoodLevel();
	int saturation = (int)Math.round(player.getSaturation());
	String hungerBar = "";
	String saturationBar = ChatColor.YELLOW + "";
	for(int i = 0; i < hunger; i++)
	{
		hungerBar += "|";
	}
	for(int i = hunger; i < 20; i++)
	{
		hungerBar += ".";
	}
	for(int i = 0; i < saturation; i++)
	{
		saturationBar += "|";
	}
	
	if(hunger >= 20)
		hungerBar = ChatColor.GREEN + hungerBar;
	else if(hunger <= 6)
		hungerBar = ChatColor.RED + hungerBar;
	else
		hungerBar = ChatColor.GOLD + hungerBar;
	
	return Arrays.asList(ChatColor.GOLD + Words.get("Hunger"), hungerBar + ChatColor.RESET, saturationBar);
}
 
开发者ID:FattyMieo,项目名称:SurvivalPlus,代码行数:28,代码来源:Survival.java

示例12: onCommand

public void onCommand(CommandSender sender, String[] args) throws CommandException {
    StringBuilder builder = new StringBuilder(ChatColor.GOLD + "Arena(s): " + ChatColor.GRAY);

    ManagerHandler.getArenaManager().getArenas().values().forEach(arena -> {
        builder.append(arena.getName() + ChatColor.GRAY + ", ");
    });

    sender.sendMessage(builder.toString());
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:9,代码来源:ArenaListArgument.java

示例13: getDisplayName

@Override
public String getDisplayName(CommandSender sender) {
    return ChatColor.GOLD + "Glowstone Mountain";
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:4,代码来源:GlowstoneMountainFaction.java

示例14: getDisplayName

@Override
public String getDisplayName(Faction faction) {
    return ChatColor.BLUE + getName() + ' ' + ChatColor.GOLD + getEventType().getDisplayName();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:4,代码来源:EventFaction.java

示例15: execute

@Override
public void execute(Player player, String[] args) {

    if (args.length == 0) {
        player.sendMessage(usage());
        return;
    }

    Player user = Bukkit.getPlayer(args[1]);
    if (user == null) {
        player.sendMessage(ChatColor.RED + "Player not found.");
        return;
    }


    player.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "----------------------------------------------------");
    player.sendMessage(ChatColor.RED + ChatUtility.getCenteredMessage("Viewing report for " + ChatColor.GREEN + user.getName()));
    player.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "----------------------------------------------------");

    // get basic info about the player.
    String OP = user.isOp() ? ChatColor.RED + "true" : ChatColor.GREEN + "false";
    String gamemode = ChatColor.GOLD + "GameMode: " + ChatColor.BLUE + StringUtils.capitalize(user.getGameMode().toString()
            .toLowerCase());
    String world = ChatColor.GOLD + "World: " + ChatColor.BLUE + user.getWorld().getName();

    // send them their total violation level
    int totalLevel = Arc.getViolationHandler().getViolationData(user).getTotalLevel();
    player.sendMessage(ChatUtility.getCenteredMessage(ChatColor.GREEN + "" + user.getName() + "'s total violation level: " + ChatColor.RED + totalLevel));

    // append the cheatprobability.
    CheatProbability probability = totalLevel <= 30 ? CheatProbability.NOT_LIKELY : totalLevel <= 60 ? CheatProbability.LIKELY :
            CheatProbability.DEFINITELY;
    player.sendMessage(ChatUtility.getCenteredMessage(ChatColor.GREEN + "Probability this player is cheating: " + ChatColor.RED +
            probability.getName()));

    // Send some basic stats.
    player.sendMessage(ChatUtility.getCenteredMessage(ChatColor.DARK_GRAY + "[" + ChatColor.GOLD
            + "Operator: " + OP + ChatColor.DARK_GRAY + "] [" + gamemode + ChatColor.DARK_GRAY + "] [" + world + ChatColor.DARK_GRAY +
            "]"));

    // start displaying check info.
    player.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "----------------------------------------------------");

    Map<CheckType, Integer> checks = Arc.getViolationHandler().getViolationData(user).getViolatedChecks();
    List<String> sorted = new ArrayList<>();

    // get all checks we have failed and put them in a list to be sorted.
    for (CheckType check : checks.keySet()) {
        int violationLevel = checks.get(check);
        String centered = ChatUtility.getCenteredMessage(ChatColor.RED + check.getCheckName() + ChatColor.GOLD + " violations: " +
                ChatColor.RED + violationLevel + ChatColor.GOLD + ".");
        sorted.add(centered);
    }

    // sort and send.
    sorted.sort(Comparator.comparingInt(String::length));
    sorted.forEach(player::sendMessage);

}
 
开发者ID:Vrekt,项目名称:Arc-v2,代码行数:59,代码来源:CommandSummary.java


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