Which Way is a chest facing? NEWS?

Discussion in 'Plugin Development' started by hpdvs2, Aug 24, 2012.

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

    hpdvs2

    North East West South; which direction is a chest facing? I do not see a blockface property on the chest to indicate that. How do I found out?

    Thanks.
     
  2. Offline

    sternmin8or

    Ne0nx3r0 likes this.
  3. Offline

    hpdvs2

    Either that, or which face is a button on. My plugin uses a button and a chest. I need to deal with rotation of its setup, so I need to know which direction either the button or the chest is facing. any ideas?
     
  4. The byte value is the direction/attached face... it's pretty simple to use...

    But if you *really* want BlockFace enums, you can use DirectionalContainer class or just Chest class.
    Code:
    Chest chest = new Chest(0, chestBlock.getData(); // type is irelevant
    Button button = new Button(0, buttonBlock.getData());
    And you can use .getFacing() on chest and .getFacing() or .getAttachedFace() on button.

    Also... Chest and Button there are materials, not blocks, make sure you import org.bukkit.material.Chest/Button for it.
     
Thread Status:
Not open for further replies.

Share This Page