Пример #1
0
  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);
  }
Пример #2
0
 /* Event hooks */
 public void didPlaceBlock(World world, BlockPos pos, IBlockState state) {
   super.didPlaceBlock(world, pos, state);
   this.setDefaultDirection(world, pos, state);
 }