/** * @deprecated Does not work (correctly) anymore */ @Deprecated public void setOpen(boolean isOpen) { setData((byte) (isOpen ? (getData() | 0x4) : (getData() & ~0x4))); }
/** * Set the direction that this door should is facing. * * @param face the direction * @deprecated Does not work (correctly) anymore */ @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x12); switch (face) { case NORTH: data |= 0x1; break; case EAST: data |= 0x2; break; case SOUTH: data |= 0x3; break; } setData(data); }
/** * Configure this part of the door to be either the top or the bottom half * * @param isTopHalf True to make it the top half. * @deprecated Shouldn't be used anymore */ @Deprecated public void setTopHalf(boolean isTopHalf) { setData((byte) (isTopHalf ? (getData() | 0x8) : (getData() & ~0x8))); }
@Override public void onBlockChanged(GlowBlock block, Material oldType, byte oldData, Material newType, byte newData) { if (newType != Material.AIR) { return; } if (oldType.getData() == Door.class) { Door door = new Door(oldType); door.setData(oldData); if (door.isTopHalf()) { Block b = block.getRelative(BlockFace.DOWN); if (b.getState().getData() instanceof Door) { b.setType(Material.AIR); } } else { Block b = block.getRelative(BlockFace.UP); if (b.getState().getData() instanceof Door) { b.setType(Material.AIR); } } } }
/** * @deprecated Does not work (correctly) anymore */ @Deprecated public void setOpen(boolean isOpen) { setData((byte) (isOpen ? (getData() | 0x4) : (getData() & ~0x4))); }
/** * Set the direction that this door should is facing. * * @param face the direction * @deprecated Does not work (correctly) anymore */ @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x12); switch (face) { case NORTH: data |= 0x1; break; case EAST: data |= 0x2; break; case SOUTH: data |= 0x3; break; } setData(data); }
/** * Configure this part of the door to be either the top or the bottom half * * @param isTopHalf True to make it the top half. * @deprecated Shouldn't be used anymore */ @Deprecated public void setTopHalf(boolean isTopHalf) { setData((byte) (isTopHalf ? (getData() | 0x8) : (getData() & ~0x8))); }