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


Java FancyMessage.send方法代码示例

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


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

示例1: updateAll

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
private List updateAll(List voters, FancyMessage message) {
    for (Player player : plugin.getServer().getOnlinePlayers()) {
        Voter voter = new Voter(player.getUniqueId());
        if (isInOverworld(player) && player.hasPermission("skipnight.vote")) {
            if (!voters.contains(voter)) {
                for (int i = 0; i < messageArray.length; i++) messageArray[i].send(player);
                voters.add(voter);
                bar.addPlayer(player);
            }
            message.send(player);
        } else {
            if (voters.contains(voter)) {
                voter = (Voter) voters.get(voters.lastIndexOf(voter));
                if (voter.getVote() == 1) yes--;
                if (voter.getVote() == -1) no--;
                voters.remove(voter);
            }
            bar.removePlayer(player);
        }
    }
    playerCount = voters.size();
    return voters;
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:24,代码来源:Vote.java

示例2: broadcastMessage

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
private void broadcastMessage(Player player, ItemStack itemStack) {
  String locale = mythicDrops.getConfigSettings().getFormattedLanguageString("command.found-item-broadcast",
      new String[][]{{"%receiver%",
          player.getName()}});
  String[] messages = locale.split("%item%");
  FancyMessage fancyMessage = new FancyMessage("");
  for (int i1 = 0; i1 < messages.length; i1++) {
    String key = messages[i1];
    if (i1 < messages.length - 1) {
      fancyMessage.then(key).then(itemStack.getItemMeta().getDisplayName()).itemTooltip(itemStack);
    } else {
      fancyMessage.then(key);
    }
  }
  for (Player p : player.getWorld().getPlayers()) {
    fancyMessage.send(p);
  }
}
 
开发者ID:Nunnery,项目名称:MythicDrops,代码行数:19,代码来源:ItemSpawningListener.java

示例3: addItem

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
public void addItem(Player player, ItemStack item, String mode) {
//Affichage du nom
String name = plugin.craftFormat.getName(item);
player.sendMessage("§7" + plugin.lang.getTranslation("craftmaking_item_added") + "§a " + name);
//Ajout définitif
CraftArray globalcraft = plugin.craft.get(player);
int nb = -1;
if(mode == "craft") {
	globalcraft.addCraftItem(item);
} else {
	globalcraft.addResultItem(item);
	nb = globalcraft.getResultItems().indexOf(item);
}
plugin.craft.put(player, globalcraft);
//Recap
plugin.craftFormat.getCraftRecap(globalcraft, "§e" + plugin.lang.getTranslation("craftmaking_craft_contents"), true).send(player);
//Options
FancyMessage options = new FancyMessage("§3" + plugin.lang.getTranslation("craftmaking_craft_options") + " ");
//Probability
if(nb > -1) {
	options.then("[" + plugin.lang.getTranslation("craftmaking_craft_options_dropchance") + "]")
	.color(ChatColor.GOLD).tooltip("§b" + plugin.lang.getTranslation("general_click_here")).suggest("/ccc setdropchance " + nb + " <0.01-100>").then(" ");
}
//Next Step
options.then("[" + plugin.lang.getTranslation("craftmaking_next_step") + "]").color(ChatColor.GREEN).style(ChatColor.BOLD).tooltip("§b" + plugin.lang.getTranslation("general_click_here")).command("next");
options.send(player);
//Rappel commandes
player.sendMessage("§7§l§m-----");
  }
 
开发者ID:Slaymd,项目名称:CaulCrafting,代码行数:30,代码来源:Editor.java

示例4: sendMessage

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
public void sendMessage(FancyMessage fancyMessage) {
    for (Player p : getPlayers()) {
        fancyMessage.send(p);
    }

    for (UUID uuid : this.spectators) {
        if (Bukkit.getPlayer(uuid) != null) {
            fancyMessage.send(Bukkit.getPlayer(uuid));
        }
        else {
            this.spectators.remove(uuid);
        }
    }
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:15,代码来源:FfaMatch.java

示例5: sendMessage

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
public void sendMessage(FancyMessage fancyMessage) {
    for (Player p : getPlayers()) {
        fancyMessage.send(p);
    }

    for (UUID uuid : spectators) {
        if (Bukkit.getPlayer(uuid) != null) {
            fancyMessage.send(Bukkit.getPlayer(uuid));
        } else {
            spectators.remove(uuid);
        }
    }
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:14,代码来源:SoloMatch.java

示例6: sendMessage

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
public void sendMessage(FancyMessage fancyMessage) {
    for (Player p : getPlayers()) {
        fancyMessage.send(p);
    }

    for (UUID uuid : this.spectators) {
        if (Bukkit.getPlayer(uuid) != null) {
            fancyMessage.send(Bukkit.getPlayer(uuid));
        } else {
            this.spectators.remove(uuid);
        }
    }
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:14,代码来源:TeamMatch.java

示例7: sendItem

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
public boolean sendItem(Player from, Player to, ItemStack item, String message) {
    FancyMessage fancyMessage = getMessage(from, item, message);
    if(fancyMessage != null) {
        fancyMessage.send(to);
    }
    return fancyMessage != null;
}
 
开发者ID:bendem,项目名称:ItemToChat,代码行数:8,代码来源:ItemToChat.java

示例8: onCommand

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
@Override
public final boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
	// If command does not equal to 'EmojiX' then return
	if (!cmd.getName().equalsIgnoreCase("EmojiX"))
		return false;

	// Checks to see if Player has permission to use help command
	if (!sender.hasPermission("emojix.chat.help")) {
		sender.sendMessage(
				ChatColor.translateAlternateColorCodes('&', AttributeConfig.config.getString("nopermission.color"))
						+ AttributeConfig.config.getString("nopermission.string"));
		return true;
	}

	FancyMessage emojis = new FancyMessage("");

	/*
	 * I used a HashMap for tooltip purposes, FancyMessage wasn't detecting
	 * empty string so I had to try a different approach to get the 'You
	 * have no Emojis' message
	 */
	for (Object obj : EmojiConfig.emoji.getConfigurationSection("emoji").getKeys(false)) {
		if (sender.hasPermission("emojix.chat." + obj.toString()))
			emojiHash.put(obj.toString(), EmojiConfig.emoji.getString("emoji." + obj.toString()));
		else if (sender.hasPermission("emojix.chat.*"))
			emojiHash.put(obj.toString(), EmojiConfig.emoji.getString("emoji." + obj.toString()));
		else
			continue;
	}

	// If hash is empty - Change message, else display Emojis
	if (emojiHash.isEmpty())
		emojis.then(ChatColor.translateAlternateColorCodes('&', AttributeConfig.config.getString("noemoji.color"))
				+ AttributeConfig.config.getString("noemoji.string"))
				.tooltip(ChatColor.translateAlternateColorCodes('&',
						AttributeConfig.config.getString("tt-noemoji.color"))
						+ AttributeConfig.config.getString("tt-noemoji.string"));
	else
		for (HashMap.Entry<String, String> entry : emojiHash.entrySet())
			emojis.then(entry.getValue()).color(ChatColor.WHITE).insert(entry.getValue()).tooltip(entry.getKey())
					.color(ChatColor.WHITE);

	FancyMessage header = new FancyMessage(ChatColor.translateAlternateColorCodes('&',
			AttributeConfig.config.getString("suffix.color") + "EmojiX"))
					.tooltip(ChatColor.translateAlternateColorCodes('&',
							AttributeConfig.config.getString("tt-suffix.color")
									+ AttributeConfig.config.getString("tt-suffix.string")))
					.then(" "
							+ ChatColor.translateAlternateColorCodes('&',
									AttributeConfig.config.getString("help.color"))
							+ AttributeConfig.config.getString("help.string"))
					.tooltip(ChatColor.translateAlternateColorCodes('&',
							AttributeConfig.config.getString("tt-help.color"))
							+ AttributeConfig.config.getString("tt-help.string"));
	header.send(sender);
	emojis.send(sender);
	return true;
}
 
开发者ID:pphelix,项目名称:emojix-spigot,代码行数:59,代码来源:EmojiXCommand.java

示例9: sendTop

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
private void sendTop(CommandSender sender, int page) {
    // Do not attempt to send hook worth if page requested is beyond the limit.
    int entries = plugin.getSettings().getFactionsPerPage();
    SplaySet<FactionWorth> factions = plugin.getWorthManager().getOrderedFactions();
    int maxPage = Math.max((int) Math.ceil((double) factions.size() / entries), 1);
    page = Math.max(1, Math.min(maxPage, page));

    Map<String, String> placeholders = new HashMap<>();
    placeholders.put("{page:back}", String.valueOf(page - 1));
    placeholders.put("{page:this}", String.valueOf(page));
    placeholders.put("{page:next}", String.valueOf(page + 1));
    placeholders.put("{page:last}", String.valueOf(maxPage));

    ButtonMessage back = plugin.getSettings().getBackButtonMessage();
    ButtonMessage next = plugin.getSettings().getNextButtonMessage();

    String backMsg = page == 1 ? back.getDisabled() : back.getEnabled();
    String backCmd = page == 1 ? null : "/ftop " + (page - 1);
    List<String> backTooltip = replace(back.getTooltip(), placeholders);

    String nextMsg = page == maxPage ? next.getDisabled() : next.getEnabled();
    String nextCmd = page == maxPage ? null : "/ftop " + (page + 1);
    List<String> nextTooltip = replace(next.getTooltip(), placeholders);

    if (!plugin.getSettings().getHeaderMessage().isEmpty()) {
        String headerString = replace(plugin.getSettings().getHeaderMessage(), placeholders);
        FancyMessage header = build(headerString, backMsg, backCmd, backTooltip, nextMsg, nextCmd, nextTooltip);
        header.send(sender);
    }

    if (factions.size() == 0) {
        sender.sendMessage(plugin.getSettings().getNoEntriesMessage());
        return;
    }

    int spacer = entries * --page;
    TreeIterator<FactionWorth> it = factions.iterator(spacer);
    for (int i = 0; i < entries; i++) {
        if (!it.hasNext()) break;

        FactionWorth worth = it.next();

        Map<String, String> worthPlaceholders = new HashMap<>(placeholders);
        worthPlaceholders.put("{rank}", Integer.toString(spacer + i + 1));
        worthPlaceholders.put("{relcolor}", "" + ChatColor.COLOR_CHAR + getRelationColor(plugin, sender, worth.getFactionId()).getChar());
        worthPlaceholders.put("{faction}", worth.getName());
        worthPlaceholders.put("{worth:total}", plugin.getSettings().getCurrencyFormat().format(worth.getTotalWorth()));
        worthPlaceholders.put("{count:total:spawner}", plugin.getSettings().getCountFormat().format(worth.getTotalSpawnerCount()));

        String bodyMessage = insertPlaceholders(plugin.getSettings(), worth, replace(plugin.getSettings().getBodyMessage(), worthPlaceholders));
        List<String> tooltip = insertPlaceholders(plugin.getSettings(), worth, replace(plugin.getSettings().getBodyTooltip(), worthPlaceholders));

        FancyMessage message = new FancyMessage(bodyMessage).tooltip(tooltip);
        message.send(sender);
    }

    if (!plugin.getSettings().getFooterMessage().isEmpty()) {
        String footerString = replace(plugin.getSettings().getFooterMessage(), placeholders);
        FancyMessage footer = build(footerString, backMsg, backCmd, backTooltip, nextMsg, nextCmd, nextTooltip);
        footer.send(sender);
    }
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:63,代码来源:TextCommand.java

示例10: onPlayerDeathMO

import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = false, priority = EventPriority.MONITOR)
public void onPlayerDeathMO(PlayerDeathEvent e) {
    Player killer;
    if (plugin.getConfig().getString("options.awesomeDeathMessages").equals("classic") && (killer = (Player) e.getEntity().getKiller()) instanceof Player) {
        FancyMessage m = new FancyMessage();
        m.text(e.getEntity().getDisplayName());
        m.then(" was slain by ");
        m.then(killer.getDisplayName());
        m.then(" using ");
        if (killer.getItemInHand().getType().equals(Material.AIR)) {
            m.then("only his ");
            m.then("bare hands").color(ChatColor.AQUA);
            m.then("!");
        } else {
            if (killer.getItemInHand().hasItemMeta()) {
                if (killer.getItemInHand().getItemMeta().hasDisplayName()) {
                    m.then(killer.getItemInHand().getItemMeta().getDisplayName()).style(ChatColor.ITALIC, ChatColor.UNDERLINE).color(ChatColor.AQUA);
                } else {
                    if (killer.getItemInHand().getItemMeta().hasEnchants()) {
                        m.then("enchanted ");
                    } else {
                        m.then(new Random().nextBoolean() ? "plain " : "ordinary ");
                    }
                    m.then(killer.getItemInHand().getType().toString().replace("_", " ").toLowerCase()).style(ChatColor.UNDERLINE).color(ChatColor.AQUA);
                }
                m.itemTooltip(killer.getItemInHand());
            } else {
                ArrayList<String> words = new ArrayList<>();
                words.add("his ");
                words.add("good old ");
                words.add("the precious ");
                words.add("the only ");
                words.add("just a ");
                words.add("the powerful ");
                words.add("");
                m.then(words.get(new Random().nextInt(words.size())));

                m.then(killer.getItemInHand().getType().toString().replace("_", " ").toLowerCase()).color(ChatColor.AQUA);
            }
        }
        for (Player p : plugin.getServer().getOnlinePlayers()) {
            m.send(p);
        }
    } else if (plugin.usingFaces) {
        // to be implemented
    }
}
 
开发者ID:Amunak,项目名称:AwesomeDeathMessages,代码行数:48,代码来源:PlayerDeathListener.java


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