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


Java FancyMessage类代码示例

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


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

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public static FancyMessage voteButtons() {
    //&9 - &rPlease vote: || &a&l[Yes]||cmd:/skipnight yes||ttp:&6&lClick &rhere to vote yes.|| &4&l[No]||cmd:/skipnight no||ttp:&6&lClick &rhere to vote no.
    return new FancyMessage(" - ")
                .color(BLUE)
            .then("Please vote: ")
                .color(WHITE)
            .then("[Yes]")
                .color(GREEN)
                .style(BOLD)
                .command("/skipnight yes")
                .tooltip("Click here to vote yes")
            .then(" [No]")
                .color(DARK_RED)
                .style(BOLD)
                .command("/skipnight no")
                .tooltip("Click here to vote no");
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:18,代码来源:Messages.java

示例3: votePassed

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public static FancyMessage votePassed() {
    // &7[&9Vote&7] &rVote &5&lpassed&r! Skipping the night.
    return new FancyMessage("[")
                .color(GRAY)
            .then("Vote")
                .color(BLUE)
            .then("] ")
                .color(GRAY)
            .then("Vote ")
                .color(WHITE)
            .then("passed")
                .color(BLUE)
                .style(BOLD)
            .then("! Skipping the night.")
                .color(WHITE);
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:17,代码来源:Messages.java

示例4: voteFailed

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public static FancyMessage voteFailed() {
    // &7[&9Vote&7] &rVote &5&lfailed&r! The night will not be skipped.
    return new FancyMessage("[")
                .color(GRAY)
            .then("Vote")
                .color(BLUE)
            .then("]")
                .color(GRAY)
            .then(" Vote ")
                .color(WHITE)
            .then("failed")
                .color(BLUE)
                .style(BOLD)
            .then("! The night will not be skipped.")
                .color(WHITE);
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:17,代码来源:Messages.java

示例5: DuelRequest

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public DuelRequest(Player sender, Player receiver, Ladder ladder) {
    this.identifier = UUID.randomUUID();
    this.sender = sender.getUniqueId();
    this.receiver = receiver.getUniqueId();
    this.ladder = ladder;

    new FancyMessage(
            "You have been sent a ").color(ChatColor.GRAY)
            .then(ladder.getName()).color(ChatColor.AQUA)
            .then(" duel request by ").color(ChatColor.GRAY)
            .then(sender.getName()).color(ChatColor.AQUA)
            .then(".").color(ChatColor.GRAY)
            .then(" [Click to Accept]").color(ChatColor.GREEN).command("/duel accept " + sender.getName())
            .send(receiver);

    sender.sendMessage(ChatColor.GRAY + "You have sent " + ChatColor.AQUA + receiver.getName() + ChatColor.GRAY + " a duel request.");
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:18,代码来源:DuelRequest.java

示例6: onStartup

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
@Before
public void onStartup() throws Exception
{
    parser = mock(OptionParser.class);
    help = mock(OptionSpec.class);
    when(help.options()).thenReturn(Arrays.asList("?"));
    FancyMessage mockedMessage = mock(FancyMessage.class, new WithSelfAnswer(FancyMessage.class));
    whenNew(FancyMessage.class).withAnyArguments().thenReturn(mockedMessage);
    doAnswer(new Answer<Object>() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable
        {
            ((CommandSender) invocation.getArguments()[0]).sendMessage("");
            return null;
        }
    }).when(mockedMessage).send(any(CommandSender.class));
    command = mock(Command.class);
    proxy = mock(MethodProxy.class);
    set = mock(OptionSet.class);
    defaultTesters = new ArrayList<CommandTester>();

    when(parser.parse(Matchers.<String[]>anyVararg())).thenReturn(set);
    when(set.has(help)).thenReturn(false);
}
 
开发者ID:Eluinhost,项目名称:pluginframework,代码行数:25,代码来源:DefaultCommandRouteTest.java

示例7: buildOn

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
void buildOn(FancyMessage message) {
    for (int i = 0; i < text.size(); i++) {
        TextPiece piece = text.get(i);
        piece.buildOn(message);

        if (clickEvent != null) {
            clickEvent.buildOn(message);
        }

        if (hoverEvent != null) {
            hoverEvent.buildOn(message);
        }

        if (i < text.size() - 1) {
            message.then();
        }
    }
}
 
开发者ID:Stealth2800,项目名称:MCMarkupLanguage,代码行数:19,代码来源:TempPart.java

示例8: getMessage

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
private FancyMessage getMessage(Player from, ItemStack item, String message) {
    if(!message.contains(chatStringToReplace)
            || !from.hasPermission("itemtochat.chat.message")
            || item == null
            || item.getType() == Material.AIR) {
        return null;
    }

    return new FancyMessage("<")
            .then(from.getDisplayName())
            .then("> ")
            .then(message.substring(0, message.indexOf(chatStringToReplace)))
            .then("[")
            .then()
                .color(getItemColor(item))
                .text(StringUtils.capitalize(item.getType().name().toLowerCase().replace("_", " ")))
                .itemTooltip(item)
            .then()
                .text(" x " + item.getAmount())
                .itemTooltip(item)
            .then("]")
            .then(message.substring(message.indexOf(chatStringToReplace) + chatStringToReplace.length()));
}
 
开发者ID:bendem,项目名称:ItemToChat,代码行数:24,代码来源:ItemToChat.java

示例9: advertisement

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
static String advertisement() {
	return new FancyMessage("Visit ")
		.color(GREEN)
	.then("our website")
		.color(YELLOW)
		.style(UNDERLINE)
		.link("http://awesome-server.net")
		.tooltip("AwesomeServer Forums")
	.then(" to win ")
		.color(GREEN)
	.then("big prizes!")
		.color(AQUA)
		.style(BOLD)
		.tooltip("Terms and conditions may apply. Offer not valid in Sweden.")
	.toJSONString();
}
 
开发者ID:mkremins,项目名称:fanciful,代码行数:17,代码来源:Example.java

示例10: gui

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
static String gui(String playername, int blocksEdited) {
	return new FancyMessage("Player ")
		.color(DARK_RED)
	.then(playername)
		.color(RED)
		.style(ITALIC)
	.then(" changed ").color(DARK_RED)
	.then(Integer.toString(blocksEdited)).color(AQUA)
	.then(" blocks. ").color(DARK_RED)
	.then("Roll back?")
		.color(GOLD)
		.style(UNDERLINE)
		.suggest("/rollenbacken " + playername)
		.tooltip("Be careful, this might undo legitimate edits!")
	.then(" ")
	.then("Ban?")
		.color(RED)
		.style(UNDERLINE)
		.suggest("/banhammer " + playername)
		.tooltip("Remember: only ban if you have photographic evidence of grief.")
	.toJSONString();
}
 
开发者ID:mkremins,项目名称:fanciful,代码行数:23,代码来源:Example.java

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

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

示例13: noVoteInProg

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public static FancyMessage noVoteInProg() {
    // No vote in progress! [Start Vote] (runs /skipnight)
    return new FancyMessage("No vote in progress! ")
                .color(RED)
            .then("[Start Vote]")
                .color(BLUE)
                .style(BOLD)
                .command("/skipnight")
                .tooltip("Click here to start a vote");
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:11,代码来源:Messages.java

示例14: voteStarted

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public static FancyMessage voteStarted() {
    //&7[&9Vote&7] &rA vote to skip the night has started!
    return new FancyMessage("[")
                .color(GRAY)
            .then("Vote")
                .color(BLUE)
            .then("] ")
                .color(GRAY)
            .then("A vote to skip the night has started!")
                .color(WHITE);
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:12,代码来源:Messages.java

示例15: youVoteYes

import mkremins.fanciful.FancyMessage; //导入依赖的package包/类
public static FancyMessage youVoteYes() {
    // &9 - &rYou voted &5&lyes&r.
    return new FancyMessage(" - ")
                .color(BLUE)
            .then("You voted ")
                .color(WHITE)
            .then("yes")
                .color(BLUE)
                .style(BOLD)
            .then(".")
                .color(WHITE);
}
 
开发者ID:mattboy9921,项目名称:SkipNight,代码行数:13,代码来源:Messages.java


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