Fixed Robit AI
This commit is contained in:
parent
cdf4b16ec1
commit
53a9204974
2 changed files with 5 additions and 7 deletions
|
@ -44,7 +44,6 @@ public class RobitAIFollow extends EntityAIBase
|
||||||
thePathfinder = entityRobit.getNavigator();
|
thePathfinder = entityRobit.getNavigator();
|
||||||
minDist = min;
|
minDist = min;
|
||||||
maxDist = max;
|
maxDist = max;
|
||||||
setMutexBits(3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class RobitAIPickup extends EntityAIBase
|
||||||
theWorld = entityRobit.worldObj;
|
theWorld = entityRobit.worldObj;
|
||||||
moveSpeed = speed;
|
moveSpeed = speed;
|
||||||
thePathfinder = entityRobit.getNavigator();
|
thePathfinder = entityRobit.getNavigator();
|
||||||
setMutexBits(3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,6 +51,7 @@ public class RobitAIPickup extends EntityAIBase
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(closest != null && closest.getDistanceSqToEntity(closest) > 100 && thePathfinder.getPathToXYZ(closest.posX, closest.posY, closest.posZ) != null)
|
if(closest != null && closest.getDistanceSqToEntity(closest) > 100 && thePathfinder.getPathToXYZ(closest.posX, closest.posY, closest.posZ) != null)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -81,7 +81,7 @@ public class RobitAIPickup extends EntityAIBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(closest == null)
|
if(closest == null || closest.isDead)
|
||||||
{
|
{
|
||||||
//No valid items
|
//No valid items
|
||||||
return false;
|
return false;
|
||||||
|
@ -94,7 +94,7 @@ public class RobitAIPickup extends EntityAIBase
|
||||||
@Override
|
@Override
|
||||||
public boolean continueExecuting()
|
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
|
@Override
|
||||||
|
@ -115,12 +115,12 @@ public class RobitAIPickup extends EntityAIBase
|
||||||
@Override
|
@Override
|
||||||
public void updateTask()
|
public void updateTask()
|
||||||
{
|
{
|
||||||
theRobit.getLookHelper().setLookPositionWithEntity(closest, 6.0F, theRobit.getVerticalFaceSpeed()/10);
|
|
||||||
|
|
||||||
if(!theRobit.getDropPickup())
|
if(!theRobit.getDropPickup())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
theRobit.getLookHelper().setLookPositionWithEntity(closest, 6.0F, theRobit.getVerticalFaceSpeed()/10);
|
||||||
|
|
||||||
if(--ticker <= 0)
|
if(--ticker <= 0)
|
||||||
{
|
{
|
||||||
|
@ -147,7 +147,6 @@ public class RobitAIPickup extends EntityAIBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue