程序包 org.bukkit.util
类 ChatPaginator
java.lang.Object
org.bukkit.util.ChatPaginator
ChatPaginator是聊天分页器,它会读取一长串任意长度的字符串并分割成字符串数组,
这些数组中的字符串能适当的显示在Minecraft的玩家控制台中.
原文:The ChatPaginator takes a raw string of arbitrary length and breaks it down into an array of strings appropriate for displaying on the Minecraft player console.
-
嵌套类概要
-
字段概要
修饰符和类型字段说明static final int
static final int
static final int
static final int
static final int
static final int
-
构造器概要
-
方法概要
修饰符和类型方法说明static ChatPaginator.ChatPage
使用默认的宽度和高度将原字符串分割为多页.static ChatPaginator.ChatPage
使用给定的宽度和高度将原字符串分割为多页.static String[]
将原字符串分割成一系列行.单词会被使用空格作为分割符进行包装,并在包装时考虑换行符.
-
字段详细资料
-
GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH
public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH- 另请参阅:
-
AVERAGE_CHAT_PAGE_WIDTH
public static final int AVERAGE_CHAT_PAGE_WIDTH- 另请参阅:
-
UNBOUNDED_PAGE_WIDTH
public static final int UNBOUNDED_PAGE_WIDTH- 另请参阅:
-
OPEN_CHAT_PAGE_HEIGHT
public static final int OPEN_CHAT_PAGE_HEIGHT- 另请参阅:
-
CLOSED_CHAT_PAGE_HEIGHT
public static final int CLOSED_CHAT_PAGE_HEIGHT- 另请参阅:
-
UNBOUNDED_PAGE_HEIGHT
public static final int UNBOUNDED_PAGE_HEIGHT- 另请参阅:
-
-
构造器详细资料
-
ChatPaginator
public ChatPaginator()
-
-
方法详细资料
-
paginate
使用默认的宽度和高度将原字符串分割为多页.原文:Breaks a raw string up into pages using the default width and height.
- 参数:
unpaginatedString
- 需要分割的原串pageNumber
- 承载的页数- 返回:
- 一个单独的聊天页
-
paginate
public static ChatPaginator.ChatPage paginate(String unpaginatedString, int pageNumber, int lineLength, int pageHeight) 使用给定的宽度和高度将原字符串分割为多页.原文:Breaks a raw string up into pages using a provided width and height.
- 参数:
unpaginatedString
- 需要分割的原串pageNumber
- 承载的页数lineLength
- 一个聊天行期望的长度pageHeight
- 一页中聊天行期望的高度- 返回:
- 一个单独的聊天页
-
wordWrap
将原字符串分割成一系列行.单词会被使用空格作为分割符进行包装,并在包装时考虑换行符.原文:Breaks a raw string up into a series of lines. Words are wrapped using spaces as decimeters and the newline character is respected.
- 参数:
rawString
- 需要分割的原串lineLength
- 文本行的长度- 返回:
- 包装后的文本数组
-