public void didBreakBlock(World world, BlockPos pos, IBlockState state) {
    world.withTileEntity(
        pos,
        TileEntityDispenser.class,
        t -> {
          InventoryHelper.dropInventoryItems(world, pos, t);
          world.updateComparatorOutputLevel(pos, this);
        });

    super.didBreakBlock(world, pos, state);
  }
 /* Event hooks */
 public void didPlaceBlock(World world, BlockPos pos, IBlockState state) {
   super.didPlaceBlock(world, pos, state);
   this.setDefaultDirection(world, pos, state);
 }