Create Combat Handler to help Ai to help manage which player should be at tacked

This commit is contained in:
Kam committed 2024-01-23 23:16:42 -05:00
1 parent 97d3df9f38
commit ebffc0e80e
7 files changed
+253 -69

No files matched your search

@@ -8,15 +8,15 @@ import noppes.npcs.entity.EntityNPCInterface;
public class EntityAISprintToTarget extends EntityAIBase
{
/** The entity that is leaping. */
EntityNPCInterface runner;
private EntityNPCInterface runner;
/** The entity that the leaper is leaping towards. */
EntityLivingBase runTarget;
private EntityLivingBase runTarget;
public EntityAISprintToTarget(EntityNPCInterface par1EntityLiving)
{
this.runner = par1EntityLiving;
this.setMutexBits(AiMutex.PASSIVE + AiMutex.PATHING);
this.setMutexBits(AiMutex.PASSIVE);
}
/**
@@ -37,9 +37,9 @@ public class EntityAISprintToTarget extends EntityAIBase
else
{
switch(this.runner.ai.onAttack)
{
case 0 : return this.runner.getDistanceSqToEntity(this.runTarget) >= 64.0D ? (!this.runner.onGround ? false : true) : false;
case 2 : return this.runner.getDistanceSqToEntity(this.runTarget) <= 49.0D ? (!this.runner.onGround ? false : true) : false;
{
case 0 : return !this.runner.isInRange(runTarget, 8)? (!this.runner.onGround ? false : true) : false;
case 2 : return this.runner.isInRange(runTarget, 7)? (!this.runner.onGround ? false : true) : false;
default : return false;
}
}