Fix incorrect logic in entity tick limiter to match tile entity tick limiter.

Simply a fix to the small performance shortpath.
This commit is contained in:
md_5 2015-10-07 17:23:59 +11:00
parent 2d37e27b37
commit af5daaeeeb

View file

@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ int entitiesThisCycle = 0;
+ if (tickPosition < 0) tickPosition = 0;
+ for (entityLimiter.initTick();
+ entitiesThisCycle < entityList.size() && (entitiesThisCycle % 10 == 0 || entityLimiter.shouldContinue());
+ entitiesThisCycle < entityList.size() && (entitiesThisCycle % 10 != 0 || entityLimiter.shouldContinue());
+ tickPosition++, entitiesThisCycle++) {
+ tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0;
entity = (Entity) this.entityList.get(this.tickPosition);
@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Spigot start
+ int tilesThisCycle = 0;
+ for (tileLimiter.initTick();
+ tilesThisCycle < tileEntityList.size() && (tilesThisCycle % 10 == 0 || tileLimiter.shouldContinue());
+ tilesThisCycle < tileEntityList.size() && (tilesThisCycle % 10 != 0 || tileLimiter.shouldContinue());
+ tileTickPosition++, tilesThisCycle++) {
+ tileTickPosition = (tileTickPosition < tileEntityList.size()) ? tileTickPosition : 0;
+ TileEntity tileentity = (TileEntity) this.tileEntityList.get(tileTickPosition);