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