mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
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:
@@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ int entitiesThisCycle = 0;
|
+ int entitiesThisCycle = 0;
|
||||||
+ if (tickPosition < 0) tickPosition = 0;
|
+ if (tickPosition < 0) tickPosition = 0;
|
||||||
+ for (entityLimiter.initTick();
|
+ for (entityLimiter.initTick();
|
||||||
+ entitiesThisCycle < entityList.size() && (entitiesThisCycle % 10 == 0 || entityLimiter.shouldContinue());
|
+ entitiesThisCycle < entityList.size() && (entitiesThisCycle % 10 != 0 || entityLimiter.shouldContinue());
|
||||||
+ tickPosition++, entitiesThisCycle++) {
|
+ tickPosition++, entitiesThisCycle++) {
|
||||||
+ tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0;
|
+ tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0;
|
||||||
entity = (Entity) this.entityList.get(this.tickPosition);
|
entity = (Entity) this.entityList.get(this.tickPosition);
|
||||||
@@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ int tilesThisCycle = 0;
|
+ int tilesThisCycle = 0;
|
||||||
+ for (tileLimiter.initTick();
|
+ for (tileLimiter.initTick();
|
||||||
+ tilesThisCycle < tileEntityList.size() && (tilesThisCycle % 10 == 0 || tileLimiter.shouldContinue());
|
+ tilesThisCycle < tileEntityList.size() && (tilesThisCycle % 10 != 0 || tileLimiter.shouldContinue());
|
||||||
+ tileTickPosition++, tilesThisCycle++) {
|
+ tileTickPosition++, tilesThisCycle++) {
|
||||||
+ tileTickPosition = (tileTickPosition < tileEntityList.size()) ? tileTickPosition : 0;
|
+ tileTickPosition = (tileTickPosition < tileEntityList.size()) ? tileTickPosition : 0;
|
||||||
+ TileEntity tileentity = (TileEntity) this.tileEntityList.get(tileTickPosition);
|
+ TileEntity tileentity = (TileEntity) this.tileEntityList.get(tileTickPosition);
|
||||||
|
Reference in New Issue
Block a user