本文整理汇总了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;
}
示例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");
}
示例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);
}
示例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);
}
示例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.");
}
示例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);
}
示例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();
}
}
}
示例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()));
}
示例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();
}
示例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();
}
示例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);
}
}
示例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-----");
}
示例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");
}
示例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);
}
示例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);
}