本文整理汇总了Java中org.bukkit.util.ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性的典型用法代码示例。如果您正苦于以下问题:Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性的具体用法?Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH怎么用?Java ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.util.ChatPaginator
的用法示例。
在下文中一共展示了ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendCenteredText
public ImageMessage appendCenteredText(String... text) {
for (int y = 0; y < lines.length; y++) {
if (text.length > y) {
int len = ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH - lines[y].length();
lines[y] = lines[y] + center(text[y], len);
} else {
return this;
}
}
return this;
}
示例2: ChatPage
/**
* Instantiates a new chat page.
*
* @param header the header
* @param text the text
* @param sender the sender
* @param param the param
* @throws FactoidCommandException the factoid command exception
*/
public ChatPage(String header, String text, CommandSender sender, String param) throws FactoidCommandException {
pageHeight = ChatPaginator.CLOSED_CHAT_PAGE_HEIGHT - 2;
pageWidth = ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH;
this.header = header;
this.text = text;
this.sender = sender;
this.param = param;
}
示例3: getPosToWriteCentered
/**
* Get number of space to add to center the
* given text
*
* @param text Base text
*
* @return Number of space
*/
public static int getPosToWriteCentered(String text)
{
return (ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH / 2) - (text.length() / 2);
}