use of net.minecraft.pathfinding.PathNavigator in project ChocolateQuestRepoured by TeamChocoQuest.
the class EntityAIBackstab method updatePath.
@Override
protected void updatePath(LivingEntity target) {
double distance = Math.min(4.0D, this.entity.distanceTo(target) * 0.5D);
double rad = Math.toRadians(target.yRot);
double sin = MathHelper.sin((float) rad);
double cos = MathHelper.cos((float) rad);
PathNavigator navigator = this.entity.getNavigation();
Path path = null;
for (int i = 4; path == null && i >= 0; i--) {
double d = distance * i / 4.0D;
path = navigator.createPath(target.getX() + sin * d, target.getY(), target.getZ() - cos * d, 1);
}
// Correct?!
navigator.moveTo(path, 1.0D);
}
use of net.minecraft.pathfinding.PathNavigator in project ChocolateQuestRepoured by TeamChocoQuest.
the class AbstractEntityCQR method createNavigation.
@Override
protected PathNavigator createNavigation(World worldIn) {
PathNavigator navigator = new PathNavigateGroundCQR(this, worldIn);
((GroundPathNavigator) navigator).setCanOpenDoors(this.canOpenDoors());
// ((GroundPathNavigator) navigator).setBreakDoors(this.canOpenDoors());
return navigator;
}
Aggregations