File tree Expand file tree Collapse file tree
src/main/java/cn/lunadeer/dominion/api/dtos Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515}
1616
1717group = " cn.lunadeer"
18- version = " 4.5.0 " // << The main version should keep consistent with the core module
18+ version = " 4.5.1 " // << The main version should keep consistent with the core module
1919
2020// utf-8
2121tasks.withType<JavaCompile > {
Original file line number Diff line number Diff line change @@ -282,7 +282,22 @@ public boolean intersectWith(CuboidDTO cuboid) {
282282 * @return true if this cuboid contains the other cuboid, false otherwise
283283 */
284284 public boolean contain (CuboidDTO cuboid ) {
285- return x1 () <= cuboid .x1 () && x2 () >= cuboid .x2 () && y1 () <= cuboid .y1 () && y2 () >= cuboid .y2 () && z1 () <= cuboid .z1 () && z2 () >= cuboid .z2 ();
285+ return contain (cuboid , false );
286+ }
287+
288+ /**
289+ * Checks if this cuboid contains another cuboid, optionally ignoring the y-dimension.
290+ *
291+ * @param cuboid the other cuboid to check for containment
292+ * @param ignoreY if true, ignores the y-dimension in the containment check
293+ * @return true if this cuboid contains the other cuboid, false otherwise
294+ */
295+ public boolean contain (CuboidDTO cuboid , boolean ignoreY ) {
296+ if (ignoreY ) {
297+ return x1 () <= cuboid .x1 () && x2 () >= cuboid .x2 () && z1 () <= cuboid .z1 () && z2 () >= cuboid .z2 ();
298+ } else {
299+ return x1 () <= cuboid .x1 () && x2 () >= cuboid .x2 () && y1 () <= cuboid .y1 () && y2 () >= cuboid .y2 () && z1 () <= cuboid .z1 () && z2 () >= cuboid .z2 ();
300+ }
286301 }
287302
288303 /**
You can’t perform that action at this time.
0 commit comments