this doesn't compile yet, but have something to peek at
This commit is contained in:
parent
973f1019a5
commit
5fcdd978d7
329 changed files with 3247 additions and 2953 deletions
|
@ -79,9 +79,9 @@ public class EntityAIAttackStealthMelee extends EntityAIBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean continueExecuting()
|
||||
public boolean shouldContinueExecuting()
|
||||
{
|
||||
return chicken.attackStateMachine == 1 && super.continueExecuting();
|
||||
return chicken.attackStateMachine == 1 && super.shouldContinueExecuting();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,7 +114,7 @@ public class EntityAIAttackStealthMelee extends EntityAIBase
|
|||
if (this.chicken.getNavigator().getPath() != null)
|
||||
{
|
||||
net.minecraft.pathfinding.PathPoint finalPathPoint = this.chicken.getNavigator().getPath().getFinalPathPoint();
|
||||
if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1)
|
||||
if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.x, finalPathPoint.y, finalPathPoint.z) < 1)
|
||||
failedPathFindingPenalty = 0;
|
||||
else
|
||||
failedPathFindingPenalty += 10;
|
||||
|
|
|
@ -130,7 +130,7 @@ public class EntityAIFollowOwner extends EntityAIBase
|
|||
{
|
||||
for (int i1 = 0; i1 <= 4; ++i1)
|
||||
{
|
||||
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.theWorld.getBlockState(new BlockPos(i + l, k - 1, j + i1)).isFullyOpaque() && this.isEmptyBlock(new BlockPos(i + l, k, j + i1)) && this.isEmptyBlock(new BlockPos(i + l, k + 1, j + i1)))
|
||||
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.theWorld.getBlockState(new BlockPos(i + l, k - 1, j + i1)).isTopSolid() && this.isEmptyBlock(new BlockPos(i + l, k, j + i1)) && this.isEmptyBlock(new BlockPos(i + l, k + 1, j + i1)))
|
||||
{
|
||||
this.thePet.setLocationAndAngles((double) ((float) (i + l) + 0.5F), (double) k, (double) ((float) (j + i1) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch);
|
||||
this.petPathfinder.clearPathEntity();
|
||||
|
|
|
@ -143,7 +143,7 @@ public class EntityAIGrabEffectsFromOwner extends EntityAIBase
|
|||
{
|
||||
for (int i1 = 0; i1 <= 4; ++i1)
|
||||
{
|
||||
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.theWorld.getBlockState(new BlockPos(i + l, k - 1, j + i1)).isFullyOpaque() && this.isEmptyBlock(new BlockPos(i + l, k, j + i1)) && this.isEmptyBlock(new BlockPos(i + l, k + 1, j + i1)))
|
||||
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.theWorld.getBlockState(new BlockPos(i + l, k - 1, j + i1)).isTopSolid() && this.isEmptyBlock(new BlockPos(i + l, k, j + i1)) && this.isEmptyBlock(new BlockPos(i + l, k + 1, j + i1)))
|
||||
{
|
||||
this.thePet.setLocationAndAngles((double) ((float) (i + l) + 0.5F), (double) k, (double) ((float) (j + i1) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch);
|
||||
this.petPathfinder.clearPathEntity();
|
||||
|
|
|
@ -34,7 +34,7 @@ public class EntityAIOwnerHurtByTarget extends EntityAITarget
|
|||
return false;
|
||||
} else
|
||||
{
|
||||
this.theOwnerAttacker = owner.getAITarget();
|
||||
this.theOwnerAttacker = owner.getRevengeTarget();
|
||||
int i = owner.getRevengeTimer();
|
||||
return i != this.timestamp && this.isSuitableTarget(this.theOwnerAttacker, false) && this.theDefendingTameable.shouldAttackEntity(this.theOwnerAttacker, owner);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ public class EntityAIOwnerHurtTarget extends EntityAITarget
|
|||
return false;
|
||||
} else
|
||||
{
|
||||
this.theTarget = entitylivingbase.getLastAttacker();
|
||||
int i = entitylivingbase.getLastAttackerTime();
|
||||
this.theTarget = entitylivingbase.getLastAttackedEntity();
|
||||
int i = entitylivingbase.getLastAttackedEntityTime();
|
||||
return i != this.timestamp && this.isSuitableTarget(this.theTarget, false) && this.theEntityDemonBase.shouldAttackEntity(this.theTarget, entitylivingbase);
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class EntityAIOwnerHurtTarget extends EntityAITarget
|
|||
|
||||
if (entitylivingbase != null)
|
||||
{
|
||||
this.timestamp = entitylivingbase.getLastAttackerTime();
|
||||
this.timestamp = entitylivingbase.getLastAttackedEntityTime();
|
||||
}
|
||||
|
||||
super.startExecuting();
|
||||
|
|
|
@ -56,7 +56,7 @@ public class EntityAIPickUpAlly extends EntityAIBase
|
|||
return false;
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).expandXyz(5);
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).grow(5);
|
||||
List<EntityLivingBase> list = this.entity.getEntityWorld().getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType()));
|
||||
for (EntityLivingBase testEntity : list)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ public class EntityAIPickUpAlly extends EntityAIBase
|
|||
if (this.entity.getNavigator().getPath() != null)
|
||||
{
|
||||
net.minecraft.pathfinding.PathPoint finalPathPoint = this.entity.getNavigator().getPath().getFinalPathPoint();
|
||||
if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1)
|
||||
if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.x, finalPathPoint.y, finalPathPoint.z) < 1)
|
||||
failedPathFindingPenalty = 0;
|
||||
else
|
||||
failedPathFindingPenalty += 10;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class EntityAIProtectAlly extends EntityAIBase
|
|||
@Override
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).expandXyz(5);
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).grow(5);
|
||||
List<EntityLivingBase> list = world.getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType()));
|
||||
for (EntityLivingBase testEntity : list)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ public class EntityAIProtectAlly extends EntityAIBase
|
|||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
@Override
|
||||
public boolean continueExecuting()
|
||||
public boolean shouldContinueExecuting()
|
||||
{
|
||||
return castTimer > 0;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ public class EntityAIProtectAlly extends EntityAIBase
|
|||
this.castTimer = Math.max(0, this.castTimer - 1);
|
||||
if (castTimer == 0)
|
||||
{
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).expandXyz(5);
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).grow(5);
|
||||
List<EntityLivingBase> list = world.getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType()));
|
||||
for (EntityLivingBase testEntity : list)
|
||||
{
|
||||
|
|
|
@ -40,13 +40,7 @@ public class EntityAIRetreatToHeal<T extends Entity> extends EntityAIBase
|
|||
|
||||
public EntityAIRetreatToHeal(EntityDemonBase theEntityIn, Class<T> classToAvoidIn, Predicate<? super T> avoidTargetSelectorIn, float avoidDistanceIn, double farSpeedIn, double nearSpeedIn)
|
||||
{
|
||||
this.canBeSeenSelector = new Predicate<Entity>()
|
||||
{
|
||||
public boolean apply(@Nullable Entity p_apply_1_)
|
||||
{
|
||||
return p_apply_1_.isEntityAlive() && EntityAIRetreatToHeal.this.theEntity.getEntitySenses().canSee(p_apply_1_);
|
||||
}
|
||||
};
|
||||
this.canBeSeenSelector = p_apply_1_ -> p_apply_1_.isEntityAlive() && EntityAIRetreatToHeal.this.theEntity.getEntitySenses().canSee(p_apply_1_);
|
||||
this.theEntity = theEntityIn;
|
||||
this.classToAvoid = classToAvoidIn;
|
||||
this.avoidTargetSelector = avoidTargetSelectorIn;
|
||||
|
@ -69,7 +63,7 @@ public class EntityAIRetreatToHeal<T extends Entity> extends EntityAIBase
|
|||
}
|
||||
|
||||
//This part almost doesn't matter
|
||||
List<T> list = this.theEntity.getEntityWorld().<T>getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, (double) this.avoidDistance), Predicates.and(new Predicate[] { EntitySelectors.CAN_AI_TARGET, this.canBeSeenSelector, this.avoidTargetSelector }));
|
||||
List<T> list = this.theEntity.getEntityWorld().getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, (double) this.avoidDistance), Predicates.and(EntitySelectors.CAN_AI_TARGET, this.canBeSeenSelector, this.avoidTargetSelector));
|
||||
|
||||
if (list.isEmpty())
|
||||
{
|
||||
|
@ -82,12 +76,12 @@ public class EntityAIRetreatToHeal<T extends Entity> extends EntityAIBase
|
|||
if (vec3d == null)
|
||||
{
|
||||
return false; //Nowhere to run, gotta fight!
|
||||
} else if (this.closestLivingEntity.getDistanceSq(vec3d.xCoord, vec3d.yCoord, vec3d.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity))
|
||||
} else if (this.closestLivingEntity.getDistanceSq(vec3d.x, vec3d.y, vec3d.z) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity))
|
||||
{
|
||||
return false; //I'll be headed off if I choose this direction.
|
||||
} else
|
||||
{
|
||||
this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3d.xCoord, vec3d.yCoord, vec3d.zCoord);
|
||||
this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3d.x, vec3d.y, vec3d.z);
|
||||
return this.entityPathEntity != null;
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +91,7 @@ public class EntityAIRetreatToHeal<T extends Entity> extends EntityAIBase
|
|||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
@Override
|
||||
public boolean continueExecuting()
|
||||
public boolean shouldContinueExecuting()
|
||||
{
|
||||
return this.theEntity.shouldEmergencyHeal();//!this.entityPathNavigate.noPath();
|
||||
}
|
||||
|
|
|
@ -48,12 +48,12 @@ public class EntityAIStealthRetreat extends EntityAIBase
|
|||
if (vec3d == null)
|
||||
{
|
||||
return false;
|
||||
} else if (attacked.getDistanceSq(vec3d.xCoord, vec3d.yCoord, vec3d.zCoord) < attacked.getDistanceSqToEntity(this.entity))
|
||||
} else if (attacked.getDistanceSq(vec3d.x, vec3d.y, vec3d.z) < attacked.getDistanceSqToEntity(this.entity))
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3d.xCoord, vec3d.yCoord, vec3d.zCoord);
|
||||
this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3d.x, vec3d.y, vec3d.z);
|
||||
return this.entityPathEntity != null;
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class EntityAIStealthRetreat extends EntityAIBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean continueExecuting()
|
||||
public boolean shouldContinueExecuting()
|
||||
{
|
||||
if (this.entityPathNavigate.noPath())
|
||||
{
|
||||
|
|
|
@ -48,9 +48,9 @@ public class EntityAIStealthTowardsTarget extends EntityAIBase
|
|||
} else
|
||||
{
|
||||
ticksLeft = this.entity.getEntityWorld().rand.nextInt(200) + 100;
|
||||
this.xPosition = vec3d.xCoord;
|
||||
this.yPosition = vec3d.yCoord;
|
||||
this.zPosition = vec3d.zCoord;
|
||||
this.xPosition = vec3d.x;
|
||||
this.yPosition = vec3d.y;
|
||||
this.zPosition = vec3d.z;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class EntityAIStealthTowardsTarget extends EntityAIBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean continueExecuting()
|
||||
public boolean shouldContinueExecuting()
|
||||
{
|
||||
ticksLeft--;
|
||||
if (ticksLeft <= 0)
|
||||
|
@ -86,9 +86,9 @@ public class EntityAIStealthTowardsTarget extends EntityAIBase
|
|||
|
||||
if (vec3d != null)
|
||||
{
|
||||
this.xPosition = vec3d.xCoord;
|
||||
this.yPosition = vec3d.yCoord;
|
||||
this.zPosition = vec3d.zCoord;
|
||||
this.xPosition = vec3d.x;
|
||||
this.yPosition = vec3d.y;
|
||||
this.zPosition = vec3d.z;
|
||||
this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue