From a2af8ca0b2bee2f6bd09189691c36c73e416c3f9 Mon Sep 17 00:00:00 2001 From: KAMKEEL Date: Wed, 22 Mar 2023 11:52:33 -0400 Subject: [PATCH] Apply isKilled() to update AI Tasks if NPC dies --- .../java/noppes/npcs/entity/EntityNPCInterface.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index ce7a2f603..2d2c56aa0 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -291,6 +291,8 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti if(getHealth() <= 0){ clearActivePotions(); setBoolFlag(true, 8); + updateTasks(); + updateHitbox(); } setBoolFlag(this.getAttackTarget() != null, 4); setBoolFlag(!getNavigator().noPath(), 1); @@ -618,6 +620,9 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti clearTasks(tasks); clearTasks(targetTasks); + if(isKilled()) + return; + IEntitySelector attackEntitySelector = new NPCAttackSelector(this); this.targetTasks.addTask(0, new EntityAIClearTarget(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); @@ -1018,6 +1023,13 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti width = (width / 5f) * display.modelSize; height = (height / 5f) * display.modelSize; + if(isKilled() && stats.hideKilledBody) { + width = 0.00001f; + } + if(width / 2 > worldObj.MAX_ENTITY_RADIUS) { + worldObj.MAX_ENTITY_RADIUS = width / 2; + } + this.setPosition(posX, posY, posZ); }