Slightly improved return to start checks

This commit is contained in:
Luis C.M committed 2022-05-04 03:10:16 -05:00
1 parent 85a1892c71
commit a2dd0e502a
1 file changed
+5 -1
@@ -30,11 +30,15 @@ public class EntityAIReturn extends EntityAIBase
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute() {
if (!npc.ai.returnToStart){
return false;
}
if (npc.getNavigator().noPath() || (!npc.isAttacking() && wasAttacked)){
return true;
}
if(npc.hasOwner() || !npc.ai.returnToStart || npc.isKilled() || npc.isInteracting()){
if(npc.hasOwner() || npc.isKilled() || npc.isInteracting()){
return false;
}