Opening Iron Door?

Discussion in 'Plugin Development' started by Plo124, Aug 16, 2014.

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

    Plo124

    So um, I done some research and found a Door object in bukkit, with an open and close option.

    I tried casting a blockstate to a door with no success.

    So how do I do this?
     
  2. Offline

    Funergy

    Check if the block is equal to a door and if yes then cast the block to a door like this
    Door thedoor = (Door) block;

    I think this would work
     
  3. Offline

    _Filip

    Door class is deprecated.
     
  4. Offline

    xize

    Plo124
    try casting Openable I don't know if you need to cast it to block.getState() or to block.getState().getData() though.
     
  5. Offline

    Plo124

    .getData() is a byte for blocks & a short for items
     
  6. Offline

    xize

    Plo124
    Not the getState().getData() it should return MaterialData
     
  7. Offline

    Plo124

    Problem solved. Just set the data to getData() & 0x08 to open and another thing to close
     
Thread Status:
Not open for further replies.

Share This Page