Skip to content
Permalink
Browse files

Small refactorization to parasitoid entities

  • Loading branch information...
Ri5ux committed Mar 13, 2019
1 parent b6a89ad commit 724220b858c322dcdabb0b230cbf90c6dd76085f
@@ -36,7 +36,7 @@ protected void addTasks()
this.tasks.addTask(3, new EntityAICustomAttackOnCollide(this, 0.55D, true));
this.tasks.addTask(8, new EntityAIWander(this, 0.55D));
this.targetTasks.addTask(2, new EntityAILeapAtTarget(this, 0.8F));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class, 0, false, false, this.getEntitySelector()));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class, 0, false, false, this.getImpregnationEntitiySelector()));
}

@Override
@@ -57,7 +57,7 @@ protected void addTasks()
this.tasks.addTask(1, new EntityAICustomAttackOnCollide(this, 0.55D, true));
this.tasks.addTask(2, new EntityAIWander(this, 0.55D));
this.targetTasks.addTask(0, new EntityAILeapAtTarget(this, 0.8F));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class, 0, false, false, this.getEntitySelector()));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class, 0, false, false, this.getImpregnationEntitiySelector()));
}

@Override
@@ -169,7 +169,7 @@ public void onUpdate()
{
for (EntityLivingBase entity : new ArrayList<EntityLivingBase>(entities))
{
if (!parasiteSelector.apply(entity) || entity instanceof EntityParasitoid)
if (!impregnationSelector.apply(entity) || entity instanceof EntityParasitoid)
{
entities.remove(entity);
}
@@ -123,7 +123,7 @@ public void onUpdate()

for (EntityLivingBase living : new ArrayList<EntityLivingBase>(potentialHosts))
{
if (!EntityParasitoid.parasiteSelector.apply(living))
if (!EntityParasitoid.impregnationSelector.apply(living))
{
potentialHosts.remove(living);
}

0 comments on commit 724220b

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.