MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / getCenter

Method getCenter

src/main/java/com/volmit/adapt/util/Cuboid.java:200–205  ·  view source on GitHub ↗

Get the the centre of the Cuboid @return Location at the centre of the Cuboid

()

Source from the content-addressed store, hash-verified

198 * @return Location at the centre of the Cuboid
199 */
200 public Location getCenter() {
201 int x1 = getUpperX() + 1;
202 int y1 = getUpperY() + 1;
203 int z1 = getUpperZ() + 1;
204 return new Location(getWorld(), getLowerX() + (x1 - getLowerX()) / 2.0, getLowerY() + (y1 - getLowerY()) / 2.0, getLowerZ() + (z1 - getLowerZ()) / 2.0);
205 }
206
207 /**
208 * Get the Cuboid's world.

Callers

nothing calls this directly

Calls 7

getUpperXMethod · 0.95
getUpperYMethod · 0.95
getUpperZMethod · 0.95
getWorldMethod · 0.95
getLowerXMethod · 0.95
getLowerYMethod · 0.95
getLowerZMethod · 0.95

Tested by

no test coverage detected