Change state of redstone torch?

Discussion in 'Plugin Development' started by lilkoopa, Jul 1, 2011.

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

    lilkoopa

    I'm trying to set a redstone torch off. Clearly there's more to it than just setting the type to redstone torch off. Do I need to set the data?
     
  2. Apparenty, on/off torches are different types of block, redstone_OFF has typeID 75 and redstone_ON has typeID 76, so just use setTypeId() to set its id to one of those to change the "state"
     
  3. Offline

    lilkoopa

    Thank you for replying, but I already knew this, the problem isn't setting the torch to the on or off block, the problem is setting the torch to the off block and keeping it that way.
     
  4. Oh sorry, I'v read only first sentence, my bad :D.
    Well, torches only use data to determine how is it placed (atleast from what i can see on wiki), so the solution isnt there.
    If i get it, whenever you change torch to "offState" block type, it just changes back to on state?
     
  5. Offline

    lilkoopa

    Yeeeeep
     
  6. Offline

    Shamebot

    Try listening to onRedstoneChange and setting it back.
     
  7. Yes, there obviously is a way listening to events and setting it back (or cancelling the event), but thats not really effective and "elegant" solution i would say, it could be also bad for server performance etc.
    I really thought there would be some method for making it stay in off state, but apparently theres not :S
     
  8. Offline

    Exerosis

    yes there is just set the block that its on to state powered
     
  9. Offline

    Plo124

    Guga
    Considering the light weight of the code, and it only being fired 10 times a second for each torch, it shouldnt lag the server.
     
Thread Status:
Not open for further replies.

Share This Page