No need to store location and range for changeIntention check.
This commit is contained in:
parent
fc918dba65
commit
7c86c238b9
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
@ -216,16 +216,11 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
else if (npc.getSpawn() != null)
|
else if ((npc.getSpawn() != null) && !npc.isInsideRadius3D(npc.getSpawn(), Config.MAX_DRIFT_RANGE + Config.MAX_DRIFT_RANGE))
|
||||||
{
|
|
||||||
final Location loc = npc.getSpawn();
|
|
||||||
final int range = Config.MAX_DRIFT_RANGE;
|
|
||||||
if (!npc.isInsideRadius3D(loc, range + range))
|
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intention == AI_INTENTION_IDLE)
|
if (intention == AI_INTENTION_IDLE)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user