Remove a loop in the solar generator code that was causing a big performance hit. As far as I can tell all it did was disable it if there were other solars above. By all means put it back if it was more important than that.

This commit is contained in:
Ben Spiers 2014-01-11 02:53:09 +00:00
parent f87c27aeee
commit ce7fbaaeb0

View file

@ -75,22 +75,7 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
else {
seesSun = false;
}
for(int y = yCoord+1; y < 256; y++)
{
Coord4D obj = new Coord4D(xCoord, y, zCoord, worldObj.provider.dimensionId);
Block block = Block.blocksList[obj.getBlockId(worldObj)];
if(block != null)
{
if(block.isOpaqueCube() || block.blockID == MekanismGenerators.generatorID && obj.getMetadata(worldObj) == GeneratorType.SOLAR_GENERATOR.meta)
{
seesSun = false;
break;
}
}
}
if(canOperate())
{
setActive(true);