Advertisement
Corosus

Untitled

Dec 11th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.71 KB | None | 0 0
  1. private void pathFollow()
  2.     {
  3.         Vec3 vec3 = this.getEntityPosition();
  4.         int i = this.currentPath.getCurrentPathLength();
  5.  
  6.         for (int j = this.currentPath.getCurrentPathIndex(); j < this.currentPath.getCurrentPathLength(); ++j)
  7.         {
  8.             if (this.currentPath.getPathPointFromIndex(j).yCoord != (int)vec3.yCoord)
  9.             {
  10.                 i = j;
  11.                 break;
  12.             }
  13.         }
  14.  
  15.         float f = this.theEntity.width * this.theEntity.width;
  16.         int k;
  17.  
  18.         for (k = this.currentPath.getCurrentPathIndex(); k < i; ++k)
  19.         {
  20.             if (vec3.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, k)) < (double)f)
  21.             {
  22.                 this.currentPath.setCurrentPathIndex(k + 1);
  23.             }
  24.         }
  25.        
  26.         /*
  27.         k = MathHelper.ceiling_float_int(this.theEntity.width);
  28.         int l = (int)this.theEntity.height + 1;
  29.         int i1 = k;
  30.  
  31.         for (int j1 = i - 1; j1 >= this.currentPath.getCurrentPathIndex(); --j1)
  32.         {
  33.             if (this.isDirectPathBetweenPoints(vec3, this.currentPath.getVectorFromIndex(this.theEntity, j1), k, l, i1))
  34.             {
  35.                 this.currentPath.setCurrentPathIndex(j1);
  36.                 break;
  37.             }
  38.         }*/
  39.  
  40.         if (this.totalTicks - this.ticksAtLastPos > 100)
  41.         {
  42.             if (vec3.squareDistanceTo(this.lastPosCheck) < 2.25D)
  43.             {
  44.                 this.clearPathEntity();
  45.             }
  46.  
  47.             this.ticksAtLastPos = this.totalTicks;
  48.             this.lastPosCheck.xCoord = vec3.xCoord;
  49.             this.lastPosCheck.yCoord = vec3.yCoord;
  50.             this.lastPosCheck.zCoord = vec3.zCoord;
  51.         }
  52.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement