Now that the Door API is deprecated, how do I do it? Code:java byte dataValue = block.getState().getRawData(); if(designatedState) // << should the door be open? dataValue |= 1 << 1;else dataValue &= ~(1 << 1); block.getState().setRawData(dataValue);block.setData(dataValue);block.getState().update(); Block is definitely the block at the bottom, which according to this should work. Any help would be appreciated.
Take a look at: http://jd.bukkit.org/rb/doxygen/df/d4b/Door_8java_source.html This might help you to reconstruct the way Bukkit handled it.
EDIT: Works now. Had forgotten to change the isOpen. Thanks for your help Thanks for the link. It actually worked to reconstruct the opening. However, when I try to close it: Code:java // Bukkit has: getData() & ~0x4// I have:dataValue = (byte) (dataValue & ~0x4); I'm kind of nonplussed on how this can't work ..
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html & is the AND Operator and ~ inverts a byte if dataValue is 01011000 this will happen: 0x4 = 0000 0100 ~0x4 = 1111 1011 dataValue & ~0x4 = 0101 1000 & 1111 1011 = 0101 1000 in fact.. i don't know the value of dataValue.. EDIT: Misunderstood your last post^^ Sorry. Glad it works..