Sign updating

Discussion in 'Plugin Development' started by mxE333xm, Apr 3, 2011.

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

    mxE333xm

    Code:
    Sign pSign = ((Sign)(pMine.m_SignLocation.getBlock().getState()));
    pSign.setLine(0, pMine.m_Name);
    pSign.update(true);
    But the sign doesen't update. What am I doing wrong?

    Edit: Strange: Sometimes it updates perfectly, and sometimes not.
     
  2. Offline

    Drakia

    Sign updating can be iffy. I do it in a delayed event, makes it work almost perfectly. You'll of course need to change this for your needs.
    Code:
    final Sign pSign = ((Sign)(pMine.m_SignLocation.getBlock().getState()));
    pSign.setLine(0, pMine.m_Name);
    server.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
        public void run() {
           	pSign.update();
        }
    });
    
     
    mxE333xm likes this.
  3. Offline

    mxE333xm

    Ok, thank you very much, it works perfectly for me :)
     
Thread Status:
Not open for further replies.

Share This Page