Examples of PathEntity


Examples of net.minecraft.pathfinding.PathEntity

  private boolean useSpecialCase(EntityLiving ent) {
    if(ent instanceof EntitySlime) {
      ent.faceEntity(getTarget(), 10.0F, 20.0F);
      return true;
    } else if(ent instanceof EntitySilverfish) {
      PathEntity pathentity = worldObj.getPathEntityToEntity(ent, getTarget(), getRange(), true, false, false, true);
      ((EntityCreature) ent).setPathToEntity(pathentity);
      return true;
    } else if(ent instanceof EntityBlaze) {
      return true;
    }
View Full Code Here

Examples of net.minecraft.pathfinding.PathEntity

    } else if(ent instanceof EntitySilverfish) {
      if(tickCounter < 10) {
        return;
      }
      EntitySilverfish sf = (EntitySilverfish) ent;
      PathEntity pathentity = worldObj.getPathEntityToEntity(ent, getTarget(), getRange(), true, false, false, true);
      sf.setPathToEntity(pathentity);
    } else if(ent instanceof EntityBlaze) {
      EntityBlaze mob = (EntityBlaze) ent;

      double x = (xCoord + 0.5D - ent.posX);
View Full Code Here

Examples of net.minecraft.pathfinding.PathEntity

                            {
                                boolean canRun = false;
                                Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(creature, 16, 7, Vec3.createVectorHelper(getParent().posX, getParent().posY, getParent().posZ));
                                if(vec3 != null && !(getParent().getDistanceSq(vec3.xCoord, vec3.yCoord, vec3.zCoord) < getParent().getDistanceSqToEntity(creature)))
                                {
                                    PathEntity newPath = new PathEntity(new PathPoint[] { new PathPoint((int)vec3.xCoord, (int)vec3.yCoord, (int)vec3.zCoord) });
                                    creature.getNavigator().setPath(newPath, 1D);
                                    canRun = true;
                                }
                                if(canRun)
                                    creature.getNavigator().setSpeed(runSpeed);
View Full Code Here

Examples of net.minecraft.pathfinding.PathEntity

    @SideOnly(Side.CLIENT)
    public boolean navigateToSurface(EntityPlayer player){
        World worldObj = player.worldObj;
        int y = worldObj.getHeightValue((int)player.posX, (int)player.posZ);
        PathEntity path = worldObj.getEntityPathToXYZ(player, (int)player.posX, y, (int)player.posZ, 300, true, true, false, true);
        if(path != null) {
            for(int i = 0; i < path.getCurrentPathLength(); i++) {
                PathPoint pathPoint = path.getPathPointFromIndex(i);
                if(worldObj.canBlockSeeTheSky(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)) {
                    coordTracker = new RenderCoordWireframe(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
                    navigator = new RenderNavigator(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
                    return true;
                }
View Full Code Here

Examples of net.minecraft.pathfinding.PathEntity

        int j2 = j1 - k1;
        int k2 = l + k1;
        int l2 = i1 + k1;
        int i3 = j1 + k1;
        ChunkCache chunkcache = new ChunkCache(par1Entity.worldObj, l1, i2, j2, k2, l2, i3, 0);
        PathEntity pathentity = new PathFinderDrone(par1Entity, chunkcache, par6, par7, pathThroughLiquid, par9).createEntityPathTo(par1Entity, par2, par3, par4, par5);
        if(pathentity != null) {
            PathPoint finalPoint = pathentity.getFinalPathPoint();
            if(finalPoint == null || finalPoint.xCoord != par2 || finalPoint.yCoord != par3 || finalPoint.zCoord != par4) pathentity = null;
        }
        teleportCounter = pathentity != null ? -1 : 0;
        telX = par2;
        telY = par3;
View Full Code Here

Examples of net.minecraft.pathfinding.PathEntity

            }
            if(!isSuffocating) {
                suffocationCounter = 40;
            }
            isSuffocating = false;
            PathEntity path = getNavigator().getPath();
            if(path != null) {
                PathPoint target = path.getFinalPathPoint();
                if(target != null) {
                    setTargetedBlock(target.xCoord, target.yCoord, target.zCoord);
                } else {
                    setTargetedBlock(0, 0, 0);
                }
View Full Code Here

Examples of net.minecraft.server.PathEntity

      double z = location.getZ();
      if(!navigation.a(x, y, z, speed)) {
        int dx = MathUtil.floor(x);
        int dy = (int) y;
        int dz = MathUtil.floor(z);
        PathEntity path = nmsEntity.world.a(nmsEntity, dx, dy, dz, (float) this.getPathfindingRange(), true, false, false, true);
        this.moveWithPath(path, speed);
      }
    }
  }
View Full Code Here

Examples of net.minecraft.server.PathEntity

    EntityLiving nmsEntity = CommonNMS.getNative(this.entity);
    net.minecraft.server.Entity nmsTargetEntity = CommonNMS.getNative(entity);
    if(nmsEntity instanceof EntityInsentient) {
      Navigation navigation = (Navigation) EntityLivingRef.getNavigation.invoke(nmsEntity);
      if(!navigation.a(nmsTargetEntity, speed)) {
        PathEntity path = nmsEntity.world.findPath(nmsEntity, nmsTargetEntity, (float) this.getPathfindingRange(), true, false, false, true);
        this.moveWithPath(path, speed);
      }
    }
  }
View Full Code Here

Examples of net.minecraft.server.v1_7_R1.PathEntity

    for(int i = 0; i < this.m_nodes.length; i++)
    {
      BlockNode node = this.m_nodes[i];
      points[i] = new PathPoint(node.getX(), node.getZ(), node.getZ());
    }
    return new PathEntity(points);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.