mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
More carve checking
This commit is contained in:
parent
80aa87935d
commit
be88d584cf
@ -460,7 +460,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
if (yv < 0) {
|
||||
if (config.getMode().equals(ObjectPlaceMode.CENTER_HEIGHT)) {
|
||||
y = (c != null ? c.getSurface() : placer.getHighest(x, z, getLoader(), config.isUnderwater())) + rty;
|
||||
if (placer.isCarved(x, y, z) || placer.isCarved(x, y - 1, z)) {
|
||||
if (placer.isCarved(x, y, z) || placer.isCarved(x, y - 1, z) || placer.isCarved(x, y - 2, z) || placer.isCarved(x, y - 3, z)) {
|
||||
bail = true;
|
||||
}
|
||||
} else if (config.getMode().equals(ObjectPlaceMode.MAX_HEIGHT) || config.getMode().equals(ObjectPlaceMode.STILT)) {
|
||||
@ -471,7 +471,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j++) {
|
||||
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
|
||||
|
||||
if (placer.isCarved(i, h, j)) {
|
||||
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
|
||||
bail = true;
|
||||
break;
|
||||
}
|
||||
@ -489,7 +489,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j += (rotatedDimensions.getBlockZ() / 2) + 1) {
|
||||
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
|
||||
|
||||
if (placer.isCarved(i, h, j)) {
|
||||
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
|
||||
bail = true;
|
||||
break;
|
||||
}
|
||||
@ -507,7 +507,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
for (int i = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i <= x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i++) {
|
||||
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j++) {
|
||||
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
|
||||
if (placer.isCarved(i, h, j)) {
|
||||
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
|
||||
bail = true;
|
||||
break;
|
||||
}
|
||||
@ -524,7 +524,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
for (int i = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i <= x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i += (rotatedDimensions.getBlockX() / 2) + 1) {
|
||||
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j += (rotatedDimensions.getBlockZ() / 2) + 1) {
|
||||
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
|
||||
if (placer.isCarved(i, h, j)) {
|
||||
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
|
||||
bail = true;
|
||||
break;
|
||||
}
|
||||
@ -535,20 +535,20 @@ public class IrisObject extends IrisRegistrant {
|
||||
}
|
||||
} else if (config.getMode().equals(ObjectPlaceMode.PAINT)) {
|
||||
y = placer.getHighest(x, z, getLoader(), config.isUnderwater()) + rty;
|
||||
if (placer.isCarved(x, y, z)) {
|
||||
if (placer.isCarved(x, y, z) || placer.isCarved(x, y-1, z)|| placer.isCarved(x, y-2, z)|| placer.isCarved(x, y-3, z)) {
|
||||
bail = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
y = yv;
|
||||
if (placer.isCarved(x, y, z)) {
|
||||
if (placer.isCarved(x, y, z) || placer.isCarved(x, y-1, z)|| placer.isCarved(x, y-2, z)|| placer.isCarved(x, y-3, z)) {
|
||||
bail = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (yv >= 0 && config.isBottom()) {
|
||||
y += Math.floorDiv(h, 2);
|
||||
bail = placer.isCarved(x, y, z);
|
||||
bail = placer.isCarved(x, y, z) || placer.isCarved(x, y-1, z)|| placer.isCarved(x, y-2, z)|| placer.isCarved(x, y-3, z);
|
||||
}
|
||||
|
||||
if (bail) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user