예제 #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);
 }
예제 #2
0
 @Override
 public boolean isToggled(Block block) {
   return block.isDataBitSet(0x8);
 }
예제 #3
0
 @Override
 public boolean isOpen(Block block) {
   return block.isDataBitSet(0x4);
 }
예제 #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);
 }
예제 #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);
 }