Get the the centre of the Cuboid @return Location at the centre of the Cuboid
()
| 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. |