Converting the Block object to a Stairs object?

Discussion in 'Plugin Development' started by VoidWhisperer, Aug 12, 2012.

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

    VoidWhisperer

    I've already tried .getData() and .getState(), along with the block itself. If I have a Block object, how would i convert it to a Stairs object? (say, if i wanted to turn the stairs..)

    Anyone have an idea on how to do this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  2. Offline

    Rockslide

    The direction of a stairsblock is stored in its data.

    For example:

    block.setType(53);
    block.setData((byte)2);

    Would make it woodenstairs facing south.

    I don't know which data value is which direction off the top of my head, but data 0-7 covers all directions.
    4-7 is upside down.
     
Thread Status:
Not open for further replies.

Share This Page