Package net.minecraft.pathfinding

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


    } 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

                            {
                                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

    @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

        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

            }
            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

TOP

Related Classes of net.minecraft.pathfinding.PathEntity

Copyright © 2018 www.massapicom. 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.