本文整理汇总了Java中mkremins.fanciful.FancyMessage.style方法的典型用法代码示例。如果您正苦于以下问题:Java FancyMessage.style方法的具体用法?Java FancyMessage.style怎么用?Java FancyMessage.style使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mkremins.fanciful.FancyMessage
的用法示例。
在下文中一共展示了FancyMessage.style方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildOn
import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
void buildOn(FancyMessage message) {
message.text(text);
if (color != null && color.isColor()) {
message.color(color);
}
if (underline) {
message.style(ChatColor.UNDERLINE);
}
if (strikeout) {
message.style(ChatColor.STRIKETHROUGH);
}
if (italicize) {
message.style(ChatColor.ITALIC);
}
if (bold) {
message.style(ChatColor.BOLD);
}
if (magic) {
message.style(ChatColor.MAGIC);
}
}
示例2: formatEmote
import mkremins.fanciful.FancyMessage; //导入方法依赖的package包/类
public FancyMessage formatEmote(Player talking, String message) {
FancyMessage fancy = new FancyMessage("");
String format = pluginConfig.getString("emotes.format");
ChatColor chatColour = null;
ChatColor chatFormat = null;
for (int i = 0; i < format.length(); i++) {
if (format.charAt(i) == '&') {
ChatColor colourOrFormat = ChatColor.getByChar(format.charAt(i + 1));
if (colourOrFormat.isColor()) chatColour = colourOrFormat;
if (colourOrFormat.isFormat()) chatFormat = colourOrFormat;
i += 1;
} else if (format.substring(i, i + ("%channel%").length()).equalsIgnoreCase("%channel%")) {
fancy.then("emote");
if (chatColour != null) fancy.color(chatColour);
if (chatFormat != null) fancy.style(chatFormat);
i += ("%channel%").length() - 1;
} else if (format.substring(i, i + ("%player%").length()).equalsIgnoreCase("%player%")) {
fancy.then(talking.getDisplayName());
fancy.tooltip(talking.getName());
if (chatColour != null) fancy.color(chatColour);
if (chatFormat != null) fancy.style(chatFormat);
i += ("%player%").length() - 1;
} else if (format.substring(i, i + ("%prefix%").length()).equalsIgnoreCase("%prefix%")) {
fancy.then(getPlayerPrefix(talking));
if (chatColour != null) fancy.color(chatColour);
if (chatFormat != null) fancy.style(chatFormat);
i += ("%prefix%").length() - 1;
} else if (format.substring(i, i + ("%ign%").length()).equalsIgnoreCase("%ign%")) {
fancy.then(talking.getName());
fancy.tooltip(talking.getDisplayName());
if (chatColour != null) fancy.color(chatColour);
if (chatFormat != null) fancy.style(chatFormat);
i += ("%ign%").length() - 1;
} else if (format.substring(i, i + ("%message%").length()).equalsIgnoreCase("%message%")) {
fancy.then(message.replace("*", ""));
if (chatColour != null) fancy.color(chatColour);
if (chatFormat != null) fancy.style(chatFormat);
i += ("%message%").length() - 1;
} else {
fancy.then(Character.toString(format.charAt(i)));
if (chatColour != null) fancy.color(chatColour);
if (chatFormat != null) fancy.style(chatFormat);
}
}
return fancy;
}