Fixed Robit AI

This commit is contained in:
aidancbrady 2016-07-05 18:23:22 -04:00
parent cdf4b16ec1
commit 53a9204974
2 changed files with 5 additions and 7 deletions

View file

@ -44,7 +44,6 @@ public class RobitAIFollow extends EntityAIBase
thePathfinder = entityRobit.getNavigator();
minDist = min;
maxDist = max;
setMutexBits(3);
}
@Override

View file

@ -42,7 +42,6 @@ public class RobitAIPickup extends EntityAIBase
theWorld = entityRobit.worldObj;
moveSpeed = speed;
thePathfinder = entityRobit.getNavigator();
setMutexBits(3);
}
@Override
@ -52,6 +51,7 @@ public class RobitAIPickup extends EntityAIBase
{
return false;
}
if(closest != null && closest.getDistanceSqToEntity(closest) > 100 && thePathfinder.getPathToXYZ(closest.posX, closest.posY, closest.posZ) != null)
{
return true;
@ -81,7 +81,7 @@ public class RobitAIPickup extends EntityAIBase
}
}
if(closest == null)
if(closest == null || closest.isDead)
{
//No valid items
return false;
@ -94,7 +94,7 @@ public class RobitAIPickup extends EntityAIBase
@Override
public boolean continueExecuting()
{
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getFollowing() && theRobit.getEnergy() > 0 && closest.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId;
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getDropPickup() && theRobit.getEnergy() > 0 && closest.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId;
}
@Override
@ -115,12 +115,12 @@ public class RobitAIPickup extends EntityAIBase
@Override
public void updateTask()
{
theRobit.getLookHelper().setLookPositionWithEntity(closest, 6.0F, theRobit.getVerticalFaceSpeed()/10);
if(!theRobit.getDropPickup())
{
return;
}
theRobit.getLookHelper().setLookPositionWithEntity(closest, 6.0F, theRobit.getVerticalFaceSpeed()/10);
if(--ticker <= 0)
{
@ -147,7 +147,6 @@ public class RobitAIPickup extends EntityAIBase
}
}
}
}
}
}