Chat Color Help

Discussion in 'Plugin Development' started by zachoooo, Mar 10, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    zachoooo

    In my plugin I have a system in which it breaks up messages into an array. This way the words will wrap.


    My chat wrapper would convert that to:


    The only problem is that colors dont persist. Since the messages are split up into an array, the colors dont continue onto the next line. Does anyone have an idea on how to get the color that the old message was in and continue it onto the next line? Thanks in advance!

    Anyone know how to do this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. Offline

    deltahat

    Use the new util.ChatPaginator class. It's the foundation of the new help system and gives you proper word wrap, colors persisting across multiple lines, and a way to display really long messages across multiple screens. CommandSender.sendMessage() has also been overloaded to accept an array of strings so otter output of the ChatPaginator can be sent directly to the player.

    See the implementation of HelpCommand for an example.
     
  3. Offline

    zachoooo

    What RB were these fixes made in?
     
  4. Offline

    deltahat

    The latest 1.2.3-0.2 beta.
     
  5. Offline

    zachoooo

    Well I guess I have to wait for the new bukkit release to get this fixed then... Thanks for your help.
     
Thread Status:
Not open for further replies.

Share This Page