if (w.getId(pos) == BlockType.CHEST) {
BlockEntity complexBlock =
w.getBlockEntity(x, y, z);
if (complexBlock instanceof ChestInterface) {
ChestInterface chest = (ChestInterface) complexBlock;
if (!chests.contains(chest)) chests.add((ChestInterface) complexBlock);
}
}
}