Help with chat coloring replace()

Discussion in 'Plugin Development' started by LukeFlynn, Apr 24, 2014.

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

    LukeFlynn

    So, i've got a custom plugin which deals with chat... it works quite odd but that's besides the point.
    I've got it setup so that the chat in console is colored to make it stand out (Rank colors, as I do not use prefixes/suffixes often)
    The only problem is that in putty or any terminal with a black background anyone with a DARK_GRAY username is literally unseen...
    So here is the way I have done it:

    Code:java
    1. console.sendMessage(message.replaceAll("&([0-9a-fk-or])", ChatColor.COLOR_CHAR + "$1"));


    I've tried affixing .replace("ChatColor.DARK_GRAY", "ChatColor.WHITE"); but that doesn't seem to work.
     
  2. Offline

    BillyGalbreath

    This is a limitation of the console, not the code.

    If it really bothers you, you can setup a log filter to strip out color codes.

    Changing it thebway youbare trying to will change it in the game too, defeating the purpose of having colored nicks in the first place.
     
  3. Offline

    LukeFlynn

    Do you know how I could go about doing this?
    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page