Esempio n. 1
0
 @Override
 public void onUpdate(BlockMaterial oldMaterial, Block block) {
   super.onUpdate(oldMaterial, block);
   if (!block.translate(BlockFace.BOTTOM).getMaterial().isPlacementObstacle()) {
     // turn this block into a mobile block
     Entity e =
         block
             .getWorld()
             .createAndSpawnEntity(block.getPosition(), FallingBlock.class, LoadOption.NO_LOAD);
     e.add(FallingBlock.class).setMaterial(this);
     block.setMaterial(VanillaMaterials.AIR);
   }
 }