1
0
Fork 0

更改entity和tileentity的tick跳过机制,使用随机值来决定是否跳过此次tick

kcx-1614
聪聪 2017-08-03 09:01:51 +08:00
parent 7072589e28
commit b92048bd0f
1 changed files with 2 additions and 11 deletions

View File

@ -297,12 +297,7 @@ public class CauldronHooks
return false;
}
// Skip tick interval
if (teCache.tickInterval > 0 && (world.getWorldInfo().getWorldTotalTime() % teCache.tickInterval == 0L))
{
return true;
}
return false;
return teCache.tickInterval==1||(teCache.tickInterval>0&&(world.rand.nextInt(teCache.tickInterval)==0)); // rand skip tick
}
return true;
}
@ -318,11 +313,7 @@ public class CauldronHooks
entityCache.put(pEntity.getClass(),eCache);
}
// Skip tick interval
if(eCache.tickInterval>0&&(world.getWorldInfo().getWorldTotalTime()%eCache.tickInterval==0L)){
return true;
}
return false;
return eCache.tickInterval==1||(eCache.tickInterval>0&&(world.rand.nextInt(eCache.tickInterval)==0)); // rand skip tick
}
return true;
}