Tick potion effects less frequently to reduce CPU load

This commit is contained in:
fullwall 2016-07-03 01:18:04 +08:00
parent a3bdaed3b3
commit b90b98bad2

View File

@ -279,7 +279,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
super.m(); super.m();
if (npc == null) if (npc == null)
return; return;
updateEffects = true; if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
updateEffects = true;
}
tickPotionEffects(); tickPotionEffects();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating();