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


Java ChatColor.ITALIC属性代码示例

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


在下文中一共展示了ChatColor.ITALIC属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onExecute

@Override
public void onExecute(String[] args, CommandSender sender) {
    Player player = (Player) sender;
    Set<Faction> factions = plugin.getFactionCache().getActive();

    int size = (int) (9 * Math.ceil(((double) factions.size() / 9)));
    Inventory gui = Bukkit.createInventory(null, size, FMessage.CMD_LIST_TITLE.getMessage());
    for (Faction faction : plugin.getFactionCache().getActive()) {
        int members = faction.getMembers().contains(faction.getAdmin()) ? faction.getMembers().size() : faction.getMembers().size() + 1;
        ItemStack banner = new ItemStack(Material.BANNER, members, faction.getBannerColor());
        ItemMeta meta = faction.getBanner() != null ? faction.getBanner().clone() : banner.getItemMeta();
        meta.setDisplayName(ParsingUtil.getFactionName(player, faction));

        ChatColor c = faction.getRelation(plugin.getFactionCache().getByMember(player)).getColor();
        String leader = faction.getAdmin() != null ? faction.getAdmin().getName() : ChatColor.ITALIC + "Interregnum";
        String govType = faction.getGovernmentType().getName();
        if (faction.getGovernmentType() == GovernmentType.MONARCHY) {
            govType += " (" + (faction.getDynasty() != null ? faction.getDynasty().getName() : ChatColor.ITALIC + "Interregnum") + c + ")";
        }
        String power = String.valueOf(faction.getPower());
        String provinces = String.valueOf(faction.getRegions().size());
        meta.setLore(Arrays.asList(FMessage.CMD_SHOW_GOVERNMENT_TYPE.getMessage() + c + govType,
                FMessage.CMD_SHOW_LEADER.getMessage() + c + leader,
                FMessage.CMD_SHOW_INFO.getMessage(c.toString(), power, provinces)
        ));
        meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
        banner.setItemMeta(meta);
        gui.addItem(banner);
    }
    player.openInventory(gui);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:31,代码来源:ListCommand.java

示例3: onJoin

@Override
public void onJoin(Player player) {
    if (KCPlayer.getWrapper(player).getNotes().join("").length() > 0)
        Core.alertStaff(player.getName() + " has notes. See "  + ChatColor.YELLOW + "/notes " + player.getName()
                + ChatColor.RED + " for details.");

    String gray = ChatColor.GRAY.toString() + ChatColor.ITALIC;
    player.sendMessage(TextUtils.centerChat(ChatColor.BOLD + "Kineticraft v4"));
    player.sendMessage(TextUtils.centerChat(ChatColor.AQUA.toString() + ChatColor.BOLD + "The Lost City"));
    player.sendMessage(TextUtils.centerChat(gray + "http://kineticraft.net/"));
    player.sendMessage("");
    player.sendMessage(gray + "Type " + ChatColor.YELLOW.toString() + ChatColor.ITALIC
            + "/info" + gray + " for help getting started.");
    player.sendMessage("");

    // 50 tick difference.
    Bukkit.getScheduler().runTaskLater(Core.getInstance(), () ->
            player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1F, .6929134F), 45L);

    Bukkit.getScheduler().runTaskLater(Core.getInstance(), () ->
            player.playSound(player.getLocation(), Sound.ENTITY_HORSE_ARMOR, .85F, 1.480315F), 95L);

    KCPlayer pw = KCPlayer.getWrapper(player);
    Bukkit.getScheduler().runTaskLater(Core.getInstance(), () -> {
        int newBuild = Configs.getMainConfig().getBuild();
        if (pw.isOnline() && pw.getLastBuild() != newBuild) {
            TextUtils.sendMarkup(player, "&b  ❢  &aBuild #%s &7patch notes now available. "
                    + "[command=/patchnotes]&e&l&nVIEW[/command][hover]Click here to view the latest changes.[/hover]"
                    + "  &b❢", newBuild);
            player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 0.5F);
        }
    }, 125L);

    idObjective.getScore(player.getName()).setScore(KCPlayer.getWrapper(player).getAccountId());
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:35,代码来源:GeneralMechanics.java

示例4: getRandomColor

public ChatColor getRandomColor(){
    ChatColor c = getRandomChatColor();

    if(c == ChatColor.MAGIC || c == ChatColor.STRIKETHROUGH || c == ChatColor.BOLD || c == ChatColor.ITALIC) getRandomColor();
    return c;
}
 
开发者ID:cadox8,项目名称:WC,代码行数:6,代码来源:ColorUtils.java

示例5: getName

@Override
public String getName(Entity forWhat, Player forWho) {
    return ChatColor.GREEN + "" + ChatColor.ITALIC + "Owner" + ChatColor.RESET + " `PREV`";
}
 
开发者ID:iso2013,项目名称:MultiLineAPI,代码行数:4,代码来源:ExampleSecondTagController.java

示例6: getRandomColor

public ChatColor getRandomColor(){
    ChatColor c = getRandomChatColor();

    if(c == ChatColor.MAGIC || c == ChatColor.STRIKETHROUGH || c == ChatColor.BOLD || c == ChatColor.ITALIC) return getRandomColor();
    return c;
}
 
开发者ID:cadox8,项目名称:PA,代码行数:6,代码来源:ColorUtils.java

示例7: formRadiusedMessage

/**
 * Appends a distance indicator to the formatted message
 *
 * @param channel The channel the message will be going to
 * @param sender  The player sending the message
 * @param compare The player who will be receiving the message
 * @param message The message the player is sending
 * @return The formatted chat message with the distance indicator
 */
private String formRadiusedMessage(Channel channel, Player sender, Player compare, String message)
{
    if (!sender.equals(compare))
        return "" + ChatColor.GRAY + ChatColor.ITALIC + "(" + Math.round(sender.getEyeLocation().distance(compare.getEyeLocation())) + "m) " + formatMessage(channel, sender, message);
    else
        return formatMessage(channel, sender, message);
}
 
开发者ID:codenameflip,项目名称:ChatChannels,代码行数:16,代码来源:PlayerChat.java

示例8: RunBasedTeamGame

/**
 * Constructor
 *
 * @param plugin Parent plugin
 * @param gameCodeName Game code name
 * @param gameName Game name
 * @param gameDescription Game description
 * @param magicSymbol Symbol into the scoreboard
 * @param survivalGameLoopClass Class of the game loop
 * @param personsPerTeam Number of players per team
 */
public RunBasedTeamGame(JavaPlugin plugin, String gameCodeName, String gameName, String gameDescription, String magicSymbol, Class<? extends SURVIVALLOOP> survivalGameLoopClass, int personsPerTeam)
{
    super(plugin, gameCodeName, gameName, gameDescription, ChatColor.ITALIC + magicSymbol, survivalGameLoopClass, personsPerTeam);

    this.applyModules();
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:17,代码来源:RunBasedTeamGame.java

示例9: RunBasedSoloGame

/**
 * Constructor
 *
 * @param plugin Parent plugin
 * @param gameCodeName Game code name
 * @param gameName Game name
 * @param gameDescription Game description
 * @param magicSymbol Symbol into the scoreboard
 * @param survivalGameLoopClass Class of the game loop
 */
public RunBasedSoloGame(JavaPlugin plugin, String gameCodeName, String gameName, String gameDescription, String magicSymbol, Class<? extends SURVIVALLOOP> survivalGameLoopClass)
{
    super(plugin, gameCodeName, gameName, gameDescription, ChatColor.ITALIC + magicSymbol, survivalGameLoopClass);

    this.applyModules();
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:16,代码来源:RunBasedSoloGame.java


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