Changing sign text stopped working on 1.10

Discussion in 'Spigot Plugin Development' started by LordGongorg, Jun 28, 2016.

  1. Hi all,
    My plugin needs to change the text of signs. Until 1.9.4 this worked fine using something like this:

    Code (Text):

    Sign sign = (Sign) block.getState();
    sign.setLine(0, "Portal to");
    sign.setLine(1, "NOWHERE");
    sign.setLine(2, null);
    sign.update();
     
    After switching to 1.10.x, this stopped working. However, consulting the API mentions no change in behavior regarding this. I however noticed there were two other update() methods. One of them is boolean update(boolean force). I then changed my code to:

    Code (Text):

    Sign sign = (Sign) block.getState();
    sign.setLine(0, "Portal to");
    sign.setLine(1, "NOWHERE");
    sign.setLine(2, "");
    boolean success = sign.update(true);
     
    On exit, success = true. Note also that sign object is correct, with the three lines as defined, until the end of the previous snippet.

    However, if I now add the following code after the previous snippet:
    Code (Text):

    Sign sign = (Sign) block.getState();
     
    The returned Sign has all three lines to "" (not null, but empty strings).

    Any ideas? Could this be a bug?
     
  2. md_5

    Administrator Developer

    Update, you have a bugged version.
    Also please don't select incorrect thread prefixes.
     
    • Like Like x 1
  3. Thanks! I recompiled now with the latest spnapshot and it's working again.
     
    #3 LordGongorg, Jun 29, 2016
    Last edited: Jun 29, 2016
  4. What is this "block"?
     
  5. Never mind, it was not my bug.