From b90b98bad2661b6903bd8f42c7db04165f76586c Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 3 Jul 2016 01:18:04 +0800 Subject: [PATCH] Tick potion effects less frequently to reduce CPU load --- src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index a236a449a..f373c3b3e 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -279,7 +279,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable super.m(); if (npc == null) return; - updateEffects = true; + if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { + updateEffects = true; + } tickPotionEffects(); boolean navigating = npc.getNavigator().isNavigating();