@Override public void onUpdate(BlockMaterial oldMaterial, Block block) { super.onUpdate(oldMaterial, block); boolean hasHook = VanillaMaterials.TRIPWIRE.findHook(block, getAttachedFace(block).getOpposite()) != null; if (!hasHook && !this.isToggled(block) && block.isDataBitSet(0x4)) { // play sound of wire snapping GeneralEffects.TRIPWIRE_SNAP.playGlobal(block.getPosition()); } block.setDataBits(0x4, hasHook); }
@Override public boolean isToggled(Block block) { return block.isDataBitSet(0x8); }
@Override public boolean isOpen(Block block) { return block.isDataBitSet(0x4); }
/** * Gets whether this pressure plate is pressed down * * @param block to get it of * @return True if pressed down, False if not */ public boolean isPressed(Block block) { return block.isDataBitSet(0x1); }
/** * Gets whether this liquid is flowing down * * @param block of the liquid * @return True if is flowing down, False if not */ public boolean isFlowingDown(Block block) { return block.isDataBitSet(0x8); }