Return a the block a sign is attached to -> Best way?

Discussion in 'Plugin Development' started by TobyZ28, Oct 20, 2012.

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

    TobyZ28

    Hey all, i'm trying to determine the block a WALL_SIGN is attached to. I can manually code this using a switch statement on the sign data value, but I'm pretty sure there is a more elegant solution. I noticed there is a BlockFace enumerable and such. Looking at some google cached javadoc's i thought this would work to return me the Block Face of the Sign:
    Code:
    Sign mySign = (Sign)myBlock.getState();
    BlockFace myBF = mySign.getAttachedFace();
    http://webcache.googleusercontent.c.../material/Sign.html+&cd=4&hl=en&ct=clnk&gl=ca

    However the getAttachedFace() method doesnt seem to be available for my sign object. Any idea's on what i'm doing wrong, or better yet any solutions on how to efficiently do this? :)

    http://forums.bukkit.org/threads/how-to-get-the-axis-a-sign-faces.88252/#post-1232329

    Found a solution!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
Thread Status:
Not open for further replies.

Share This Page