MCPcopy Create free account
hub / github.com/Frontrooms/3.0-GC / getDist

Method getDist

src/main/java/emu/grasscutter/utils/Utils.java:38–49  ·  view source on GitHub ↗
(Position pos1, Position pos2)

Source from the content-addressed store, hash-verified

36 }
37
38 public static double getDist(Position pos1, Position pos2) {
39 double xs = pos1.getX() - pos2.getX();
40 xs = xs * xs;
41
42 double ys = pos1.getY() - pos2.getY();
43 ys = ys * ys;
44
45 double zs = pos1.getZ() - pos2.getZ();
46 zs = zs * zs;
47
48 return Math.sqrt(xs + zs + ys);
49 }
50
51 public static int getCurrentSeconds() {
52 return (int) (System.currentTimeMillis() / 1000.0);

Callers

nothing calls this directly

Calls 3

getXMethod · 0.80
getYMethod · 0.80
getZMethod · 0.80

Tested by

no test coverage detected