[SPIGOT-3568] ChatPaginator Inconsistent Word Wrap Created: 16/Sep/17 Updated: 18/Sep/17 Resolved: 18/Sep/17 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Caleb L. Power | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | ChatPaginator, Spigot, wordWrap | ||
| Environment: |
Bukkit.getVersion() : git-Spigot-65e8124-bde2a93 (MC: 1.12.1) |
||
| Attachments: |
|
| Description |
|
The ChatPaginator.wordWrap() method does not seem to properly wrap Strings in instances where single-letter words (such as the word "a") are near the end of a line. Example Code:
String[] wrappedLines = ChatPaginator.wordWrap("You just bought 1 ticket for the 1st lottery for a total of 1.0 dollar. You now have 1 ticket.", ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH); for(String line : wrappedLines) sender.sendMessage(line); Example Output:
|
| Comments |
| Comment by Caleb L. Power [ 16/Sep/17 ] |
|
Note that in the example code, the variable "sender" is of type CommandSender and is properly initialized via the standard onCommand method. |