Getting face direction of a Dispenser?

Discussion in 'Plugin Development' started by Zeroth, Apr 8, 2011.

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

    Zeroth

    I though the getRawData() function of a Dispenser object would return a byte (wikipage) but I always get the value 0x3 (west). Ive tried calling dispenser.getBlock().getData() as well, but I think the same thing is happening. Code:
    Code:
            BlockFace face = BlockFace.SELF;
            byte fData = disp.getRawData(); //disp is a dispenser
            if (fData == 0x2) {
                face = BlockFace.EAST;
            } else if (fData == 0x3) {
                face = BlockFace.WEST;
            } else if (fData == 0x4) {
                face = BlockFace.NORTH;
            } else if (fData == 0x5) {
                face = BlockFace.SOUTH;
            }
    Any insight would be great!
     
  2. Offline

    Crash

    I think it's just disp.getData() or disp.getData().getData()

    See which works
     
  3. Offline

    Zeroth

    Neither do :/ The first one returns a MaterialData object and the second always returns 3.
     
Thread Status:
Not open for further replies.

Share This Page