3
0

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

This commit is contained in:
聪聪 2017-08-03 09:01:51 +08:00
parent 7072589e28
commit b92048bd0f

View File

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