From d532dae514cdda88f3aa7464bb434c343ed00a89 Mon Sep 17 00:00:00 2001 From: fullwall Date: Thu, 27 Oct 2022 20:15:10 +0800 Subject: [PATCH] Restore behavior tree before calling warden ai --- .../nms/v1_19_R1/entity/WardenController.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java b/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java index 33aa7a105..33c8037aa 100644 --- a/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java +++ b/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java @@ -82,17 +82,17 @@ public class WardenController extends MobEntityController { @Override public void customServerAiStep() { - if (npc != null) { - if (npc.useMinecraftAI()) { - super.customServerAiStep(); - } else { - NMSImpl.updateAI(this); - } - NMSImpl.updateMinecraftAIState(npc, this); - npc.update(); - } else { + if (npc == null) { super.customServerAiStep(); + return; } + NMSImpl.updateMinecraftAIState(npc, this); + if (npc.useMinecraftAI()) { + super.customServerAiStep(); + } else { + NMSImpl.updateAI(this); + } + npc.update(); } @Override