Beispiel #1
0
 @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);
 }
Beispiel #2
0
 @Override
 public boolean isToggled(Block block) {
   return block.isDataBitSet(0x8);
 }
Beispiel #3
0
 @Override
 public boolean isOpen(Block block) {
   return block.isDataBitSet(0x4);
 }
Beispiel #4
0
 /**
  * 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);
 }
Beispiel #5
0
 /**
  * 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);
 }