MCPcopy Index your code
hub / github.com/PaperMC/Paper / union

Method union

paper-api/src/main/java/org/bukkit/util/BoundingBox.java:579–591  ·  view source on GitHub ↗

Expands this bounding box to contain (or border) the specified position. @param posX the x position value @param posY the y position value @param posZ the z position value @return this bounding box (now expanded) @see #contains(double, double, double)

(double posX, double posY, double posZ)

Source from the content-addressed store, hash-verified

577 * @see #contains(double, double, double)
578 */
579 @NotNull
580 public BoundingBox union(double posX, double posY, double posZ) {
581 double newMinX = Math.min(this.minX, posX);
582 double newMinY = Math.min(this.minY, posY);
583 double newMinZ = Math.min(this.minZ, posZ);
584 double newMaxX = Math.max(this.maxX, posX);
585 double newMaxY = Math.max(this.maxY, posY);
586 double newMaxZ = Math.max(this.maxZ, posZ);
587 if (newMinX == this.minX && newMinY == this.minY && newMinZ == this.minZ && newMaxX == this.maxX && newMaxY == this.maxY && newMaxZ == this.maxZ) {
588 return this;
589 }
590 return this.resize(newMinX, newMinY, newMinZ, newMaxX, newMaxY, newMaxZ);
591 }
592
593 /**
594 * Expands this bounding box to contain (or border) the specified position.

Callers 2

testUnionMethod · 0.80

Calls 5

resizeMethod · 0.95
containsMethod · 0.95
getXMethod · 0.65
getYMethod · 0.65
getZMethod · 0.65

Tested by 1

testUnionMethod · 0.64