@Override public boolean shouldContinueExecuting() { Path currentPath = this.entity.getNavigator().getPath(); return this.shore != null && this.path != null && (currentPath == null || !currentPath.isFinished()); }
/** * Checks if there exists a path. * * @return true if the fence gate can be passed. */ private boolean checkPath() { @NotNull final PathNavigateGround pathnavigateground = (PathNavigateGround) this.theEntity.getNavigator(); final Path path = pathnavigateground.getPath(); return path != null && !path.isFinished() && pathnavigateground.getEnterDoors() && checkFenceGate(path); }
@Override public boolean shouldContinueExecuting() { if (this.path == null || (this.world.collidesWithAnyBlock(this.entity.getEntityBoundingBox()) && !this.isBlockLeaves(this.entity.getPosition()))) { return false; } if (!this.reachedTarget) { if (!this.path.isFinished() && !this.path.isSamePath(this.entity.getNavigator().getPath())) { return false; } } return this.active && !this.gliding; }
if (entity.getNavigator().getPath() != null && !entity.getNavigator().getPath().isFinished()) { PathPoint finalPoint = entity.getNavigator().getPath().getFinalPathPoint(); if (navigatePos.getDistance(finalPoint.x, finalPoint.y, finalPoint.z) < 25) {
@Override public void updateTask() { if (this.path != null) { this.dinosaur.getNavigator().setPath(this.path, 1.0); } if (!this.dinosaur.world.isRemote && (this.dinosaur.getDistance(this.feederPosition.getX(), this.feederPosition.getY(), this.feederPosition.getZ()) <= this.dinosaur.width * this.dinosaur.width || this.path.isFinished())) { TileEntity tile = this.dinosaur.world.getTileEntity(this.feederPosition); if (tile instanceof FeederBlockEntity) { FeederBlockEntity feeder = (FeederBlockEntity) tile; feeder.setOpen(true); feeder.setFeeding(this.dinosaur); } this.resetTask(); } }
@Override public void updateTask() { Path currentPath = this.dinosaur.getNavigator().getPath(); if (this.path != null) { PathPoint finalPathPoint = this.path.getFinalPathPoint(); if (currentPath == null || !currentPath.getFinalPathPoint().equals(finalPathPoint)) { Path path = this.dinosaur.getNavigator().getPathToXYZ(finalPathPoint.x, finalPathPoint.y, finalPathPoint.z); this.dinosaur.getNavigator().setPath(path, 1.0); this.path = path; } } if (this.giveUpTime <= 0 || (this.dinosaur.getStayAwakeTime() <= 0 && (this.path == null || this.path.isFinished()))) { this.dinosaur.setSleeping(true); } this.giveUpTime--; }
@Override public void updateTask() { if (this.giveUpTime > 0) { this.giveUpTime--; } if (this.path != null) { this.dinosaur.getNavigator().setPath(this.path, 1.0); Vec3d center = new Vec3d(this.pos.getX() + 0.5, this.pos.getY() + 0.5, this.pos.getZ() + 0.5); if (this.path.isFinished() || (this.dinosaur.getEntityBoundingBox().expand(2, 2, 2).intersectsWithXY(center) && this.giveUpTime < 10)) { this.dinosaur.getLookHelper().setLookPosition(this.pos.getX() + 0.5, this.pos.getY() + 0.5, this.pos.getZ() + 0.5, 10.0F, 10.0F); this.dinosaur.setAnimation(EntityAnimation.DRINKING.get()); MetabolismContainer metabolism = this.dinosaur.getMetabolism(); metabolism.setWater(metabolism.getWater() + (metabolism.getMaxWater() / 8)); } } }
if (this.path.isFinished()) { this.entity.setAnimation(EntityAnimation.START_CLIMBING.get()); this.reachedTarget = true;