Get the Cuboid representing the face of this Cuboid. The resulting Cuboid will be one block thick in the axis perpendicular to the requested face. @param dir which face of the Cuboid to get @return the Cuboid representing this Cuboid's requested face
(CuboidDirection dir)
| 538 | * @return the Cuboid representing this Cuboid's requested face |
| 539 | */ |
| 540 | public Cuboid getFace(CuboidDirection dir) { |
| 541 | switch (dir) { |
| 542 | case Down: |
| 543 | return new Cuboid(worldName, x1, y1, z1, x2, y1, z2); |
| 544 | case Up: |
| 545 | return new Cuboid(worldName, x1, y2, z1, x2, y2, z2); |
| 546 | case North: |
| 547 | return new Cuboid(worldName, x1, y1, z1, x1, y2, z2); |
| 548 | case South: |
| 549 | return new Cuboid(worldName, x2, y1, z1, x2, y2, z2); |
| 550 | case East: |
| 551 | return new Cuboid(worldName, x1, y1, z1, x2, y2, z1); |
| 552 | case West: |
| 553 | return new Cuboid(worldName, x1, y1, z2, x2, y2, z2); |
| 554 | default: |
| 555 | throw new IllegalArgumentException("Invalid direction " + dir); |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * Check if the Cuboid contains only blocks of the given type |
no outgoing calls
no test coverage detected