1. Guest, as per the stickied thread, this forum has not been in use since 2014. All bugs and feature requests should be posted to JIRA.

Bug SignChangeEvent (extra data from getLines)

Discussion in 'Bugs & Feature Requests' started by walrusone, Nov 28, 2014.

  1. @EventHandler
    public void signPlaced(SignChangeEvent event) {
    String[] a= event.getLines();
    String line = a[0];
    }

    This code now brings back what appears to be color data from the line of the sign. So testing just text will not work unless you parse out the extra data.

    for example, in my plugin I use:

    if (a[0].equals("[hlb]")) {

    This will no longer work as a[0] now contains a weird symbol follow by the number 0 ( a[0] returns *0[hlb] instead of just [hlb]).

    Thanks!!
     
    #1 walrusone, Nov 28, 2014
    Last edited: Nov 28, 2014
  2. harry5573

    Patron

  3. Confirmed, hope it's a bug so I don't need to update all of my plugins.
     
  4. It sends always the colorcode for black at the beginning.
    A simple
    line = ChatColor.stripColor(line);
    is stripping the colorcode out.
     
  5. joehot200

    Supporter

    It's always sent the colour code... This is nothing new.
     
  6. Thanks, good to know.

    Something is different, as you cannot just compare line data with a simple string. It's broken a few plugins that I know of. Not hard to fix, but unfortunately it will break some plugins.
     
    • Agree Agree x 1
  7. Shaggy67

    Benefactor

    Not sure if it's related, but some signs seem to have lost the [] around the text on the first line. IE, lockette signs with the first line as "[Private]" now show up as "Private". If a sign had a color tag before the first "[", those seem to still be OK.
     
  8. Thanks for tagging me!
     
    • Winner Winner x 6
    • Funny Funny x 2
    • Like Like x 1
    • Agree Agree x 1
  9. Signs as well as books now use Json for data transfer. This is a Vanilla feature. I messed about with signs about 6 months ago using command blocks and the console using json to update signs and write to books. Just encase you were aware of the change. This is not a bug in minecraft will just been CB and spigot to implement the changes, along with 100'1 over things.