Rewrote everything basing on BlockChest.