No need to store location and range for changeIntention check.

This commit is contained in:
MobiusDevelopment 2022-09-06 12:03:23 +00:00
parent fc918dba65
commit 7c86c238b9
24 changed files with 48 additions and 168 deletions

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }

View File

@ -216,14 +216,9 @@ 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(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius3D(loc, range + range))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }