Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void pathFollow()
- {
- Vec3 vec3 = this.getEntityPosition();
- int i = this.currentPath.getCurrentPathLength();
- for (int j = this.currentPath.getCurrentPathIndex(); j < this.currentPath.getCurrentPathLength(); ++j)
- {
- if (this.currentPath.getPathPointFromIndex(j).yCoord != (int)vec3.yCoord)
- {
- i = j;
- break;
- }
- }
- float f = this.theEntity.width * this.theEntity.width;
- int k;
- for (k = this.currentPath.getCurrentPathIndex(); k < i; ++k)
- {
- if (vec3.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, k)) < (double)f)
- {
- this.currentPath.setCurrentPathIndex(k + 1);
- }
- }
- /*
- k = MathHelper.ceiling_float_int(this.theEntity.width);
- int l = (int)this.theEntity.height + 1;
- int i1 = k;
- for (int j1 = i - 1; j1 >= this.currentPath.getCurrentPathIndex(); --j1)
- {
- if (this.isDirectPathBetweenPoints(vec3, this.currentPath.getVectorFromIndex(this.theEntity, j1), k, l, i1))
- {
- this.currentPath.setCurrentPathIndex(j1);
- break;
- }
- }*/
- if (this.totalTicks - this.ticksAtLastPos > 100)
- {
- if (vec3.squareDistanceTo(this.lastPosCheck) < 2.25D)
- {
- this.clearPathEntity();
- }
- this.ticksAtLastPos = this.totalTicks;
- this.lastPosCheck.xCoord = vec3.xCoord;
- this.lastPosCheck.yCoord = vec3.yCoord;
- this.lastPosCheck.zCoord = vec3.zCoord;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement