{
final double d3 = tile.xCoord + 0.5D - this.posX;
final double d4 = tile.yCoord + 0.5D - this.posY;
final double d5 = tile.zCoord + 0.5D - this.posZ;
final double dSq = d3 * d3 + d4 * d4 + d5 * d5;
TileEntityTreasureChestMars chest = (TileEntityTreasureChestMars) tile;
if (dSq < 10000)
{
if (!chest.locked)
{
chest.locked = true;
}
for (int k = 0; k < chest.getSizeInventory(); k++)
{
chest.setInventorySlotContents(k, null);
}
ChestGenHooks info = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST);
// Generate three times, since it's an extra extra special chest
WeightedRandomChestContent.generateChestContents(this.rand, info.getItems(this.rand), chest, info.getCount(this.rand));
WeightedRandomChestContent.generateChestContents(this.rand, info.getItems(this.rand), chest, info.getCount(this.rand));
WeightedRandomChestContent.generateChestContents(this.rand, info.getItems(this.rand), chest, info.getCount(this.rand));
chest.setInventorySlotContents(this.rand.nextInt(chest.getSizeInventory()), this.getGuaranteedLoot(this.rand));
break;
}
}
}