Preparing network update to 1.7
Added distanceTo for entities
This commit is contained in:
parent
45db5c17bd
commit
9da333a433
1 changed files with 7 additions and 0 deletions
|
@ -184,6 +184,13 @@ public class Vector3 implements Cloneable {
|
|||
return var2 * var2 + var4 * var4 + var6 * var6;
|
||||
}
|
||||
|
||||
public double distanceTo_square(Entity entity) {
|
||||
double var2 = entity.posX - this.x;
|
||||
double var4 = entity.posY - this.y;
|
||||
double var6 = entity.posZ - this.z;
|
||||
return var2 * var2 + var4 * var4 + var6 * var6;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiplies the vector by negative one.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue