// Spout Start
int max = tileEntities.size();
int threshold = (int) Math.min(1000, (Math.max(100, (SpoutWorth.getInstance().getAverageFPS() * 8))));
if (tileEntities.size() > threshold) {
Collections.sort((List<TileEntity>)tileEntities, new TileEntityComparator());
max = threshold / 2;
}
Iterator var8 = this.tileEntities.iterator();
int i = 0;