Search in sources :

Example 1 with EntityRatGiant

use of com.lying.variousoddities.entity.hostile.EntityRatGiant in project VariousOddities by Lyinginbedmon.

the class EntityAIRatFollowGiant method shouldExecute.

public boolean shouldExecute() {
    if (theRat.getAttackTarget() != null)
        return false;
    double distanceMin = DISTANCE_MAX;
    for (EntityRatGiant giantRat : this.theRat.world.<EntityRatGiant>getEntitiesWithinAABB(EntityRatGiant.class, theRat.getBoundingBox().grow(8.0D, 4.0D, 8.0D), new Predicate<EntityRatGiant>() {

        public boolean apply(EntityRatGiant input) {
            return input.getRatBreed() == theRat.getRatBreed();
        }
    })) {
        double distance = this.theRat.getDistanceSq(giantRat);
        if (distance <= distanceMin) {
            distanceMin = distance;
            this.theGiantRat = giantRat;
        }
    }
    return !(this.theGiantRat == null || distanceMin < 9.0D);
}
Also used : EntityRatGiant(com.lying.variousoddities.entity.hostile.EntityRatGiant)

Aggregations

EntityRatGiant (com.lying.variousoddities.entity.hostile.EntityRatGiant)1