Search in sources :

Example 1 with EntityNavigationAccessor

use of com.faboslav.friendsandfoes.mixin.EntityNavigationAccessor in project friends-and-foes by Faboslav.

the class GlareEntity method createNavigation.

protected EntityNavigation createNavigation(World world) {
    GlareNavigation glareNavigation = new GlareNavigation(this, world) {

        public boolean isValidPosition(BlockPos pos) {
            return !this.world.getBlockState(pos.down()).isAir();
        }
    };
    glareNavigation.setCanPathThroughDoors(false);
    glareNavigation.setCanSwim(false);
    glareNavigation.setCanEnterOpenDoors(true);
    EntityNavigationAccessor entityNavigation = (EntityNavigationAccessor) glareNavigation;
    entityNavigation.setNodeReachProximity(0.1F);
    return glareNavigation;
}
Also used : BlockPos(net.minecraft.util.math.BlockPos) GlareNavigation(com.faboslav.friendsandfoes.entity.ai.pathing.GlareNavigation) EntityNavigationAccessor(com.faboslav.friendsandfoes.mixin.EntityNavigationAccessor)

Aggregations

GlareNavigation (com.faboslav.friendsandfoes.entity.ai.pathing.GlareNavigation)1 EntityNavigationAccessor (com.faboslav.friendsandfoes.mixin.EntityNavigationAccessor)1 BlockPos (net.minecraft.util.math.BlockPos)1