public static bool CanDestroyChest(int X, int Y)
{
for (int index1 = 0; index1 < 1000; ++index1)
{
Chest chest = Main.chest[index1];
if (chest != null && chest.x == X && chest.y == Y)
{
for (int index2 = 0; index2 < 40; ++index2)
{
if (chest.item[index2] != null && chest.item[index2].itemId > 0 && chest.item[index2].stack > 0)
return false;
}
return true;
}
}
return true;
}