int baseY = (int)Math.floor(player.posY) - blockTrackRange + blockTrackRange * (ticksExisted % updateInterval) / (updateInterval / 2);
int maxY = (int)Math.floor(player.posY) - blockTrackRange + blockTrackRange * (ticksExisted % updateInterval + 1) / (updateInterval / 2);
baseY = MathHelper.clamp_int(baseY, 0, 255);
maxY = MathHelper.clamp_int(maxY, 0, 255);
int baseZ = (int)Math.floor(player.posZ) - blockTrackRange;
IBlockAccess chunkCache = new ChunkCache(player.worldObj, baseX, baseY, baseZ, baseX + 2 * blockTrackRange, maxY, baseZ + 2 * blockTrackRange, 0);
for(int i = baseX; i <= baseX + 2 * blockTrackRange; i++) {
for(int j = baseY; j < maxY; j++) {
for(int k = baseZ; k <= baseZ + 2 * blockTrackRange; k++) {
if(player.getDistance(i, j, k) > blockTrackRange) continue;
TileEntity te = chunkCache.getTileEntity(i, j, k);
if(searchHandler != null && te instanceof IInventory) {
searchHandler.checkInventoryForItems(te);
}
List<IBlockTrackEntry> entries = BlockTrackEntryList.instance.getEntriesForCoordinate(chunkCache, i, j, k);
if(entries.isEmpty()) continue;