Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3568

ChatPaginator Inconsistent Word Wrap

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Bukkit.getVersion() : git-Spigot-65e8124-bde2a93 (MC: 1.12.1)
      Bukkit.getBukkitVersion() : 1.12.1-R0.1-SNAPSHOT

      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:

       

            Unassigned Unassigned
            LordInateur Caleb L. Power
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: