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

Method getFace

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

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)

Source from the content-addressed store, hash-verified

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

Callers 2

contractMethod · 0.95
getBlockFaceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected