World world = pi.getOpenedChest().getWorld();
int x = pi.getOpenedChest().getX();
int y = pi.getOpenedChest().getY();
int z = pi.getOpenedChest().getZ();
if(world.getBlockAt(x, y, z).getState() instanceof Chest) {
Chest chest = (Chest)world.getBlockAt(x, y, z).getState();
ItemStack[] orig = pi.getOldChestContents();
ItemStack[] latest = chest.getInventory().getContents();
DeltaChest dc = new DeltaChest(pi.getName(), chest, orig, latest);
dc.send();
}
}
BBUsersTable.getInstance().userOpenedChest(pi.getName(), null, null); // Chest closed.