src/main/java/com/github/klikli_dev/occultism/common/entity/ai/DepositItemsGoal.java
/**
     * Opens or closes a chest
     *
     * @param target the target
     * @param open   true to open the chest, false to close it.
     */
Opens or closes a chest
@param target the target
@param open   true to open the chest, false to close it.
Opens or closes a chest @param target the target @param open true to open the chest false to close it .
public void toggleChest(IMoveTarget target, boolean open) {
        if (target instanceof BlockPosMoveTarget) {
            TileEntity tile = this.entity.level.getBlockEntity(target.getBlockPos());
            if (tile instanceof ChestTileEntity) {
                ChestTileEntity chest = (ChestTileEntity) tile;
                if (open) {
                    this.entity.level.blockEvent(this.moveTarget.getBlockPos(), chest.getBlockState().getBlock(), 1, 1);
                } else {
                    this.entity.level.blockEvent(this.moveTarget.getBlockPos(), chest.getBlockState().getBlock(), 1, 0);
                }
            }
        }
    }
public void toggleChest ( IMoveTarget target , boolean open ) { if ( target instanceof BlockPosMoveTarget ) { TileEntity tile = this . entity . level . getBlockEntity ( target . getBlockPos ( ) ) ; if ( tile instanceof ChestTileEntity ) { ChestTileEntity chest = ( ChestTileEntity ) tile ; if ( open ) { this . entity . level . blockEvent ( this . moveTarget . getBlockPos ( ) , chest . getBlockState ( ) . getBlock ( ) , 1 , 1 ) ; } else { this . entity . level . blockEvent ( this . moveTarget . getBlockPos ( ) , chest . getBlockState ( ) . getBlock ( ) , 1 , 0 ) ; } } } }
Opens or closes a chest
 @param target the target
 @param open   true to open the chest, false to close it.
Opens or closes a chest @param target the target @param open true to open the chest false to close it .