9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-26 10:39:07 +00:00

Totally didn't replace MIN_HEIGHT instead of FAST_MAX_HEIGHT 💀

This commit is contained in:
Vatuu
2022-05-22 03:22:19 +02:00
parent df98f8f626
commit d5699a7472

View File

@@ -552,38 +552,36 @@ public class IrisObject extends IrisRegistrant {
} else if(config.getMode().equals(ObjectPlaceMode.FAST_MAX_HEIGHT) || config.getMode().equals(ObjectPlaceMode.FAST_STILT)) {
BlockVector offset = new BlockVector(config.getTranslate().getX(), config.getTranslate().getY(), config.getTranslate().getZ());
BlockVector rotatedDimensions = config.getRotation().rotate(new BlockVector(getW(), getH(), getD()), spinx, spiny, spinz).clone();
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) || placer.isCarved(i, h - 1, j) || placer.isCarved(i, h - 2, j) || placer.isCarved(i, h - 3, j)) {
int x1 = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX();
int x2 = x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX();
for(int i = Math.min(x1, x2); i <= Math.max(x1, x2); i +=(rotatedDimensions.getBlockX() / 2) + 1) {
int z1 = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ();
int z2 = z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ();
for(int ii = Math.min(z1, z2); ii <= Math.max(z1, z2); ii += (rotatedDimensions.getBlockX() / 2) + 1) {
int h = placer.getHighest(i, ii, getLoader(), config.isUnderwater()) + rty;
if(placer.isCarved(i, h, ii) || placer.isCarved(i, h - 1, ii) || placer.isCarved(i, h - 2, ii) || placer.isCarved(i, h - 3, ii)) {
bail = true;
break;
}
if(h > y) {
if(h > y)
y = h;
}
}
}
} else if(config.getMode().equals(ObjectPlaceMode.MIN_HEIGHT)) {
y = rdata.getEngine().getHeight() + 1;
BlockVector offset = new BlockVector(config.getTranslate().getX(), config.getTranslate().getY(), config.getTranslate().getZ());
BlockVector rotatedDimensions = config.getRotation().rotate(new BlockVector(getW(), getH(), getD()), spinx, spiny, spinz).clone();
int x1 = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX();
int x2 = x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX();
for(int i = Math.min(x1, x2); i <= Math.max(x1, x2); i++) {
int z1 = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ();
int z2 = z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ();
for(int ii = Math.min(z1, z2); ii <= Math.max(z1, z2); ii++) {
int h = placer.getHighest(i, ii, getLoader(), config.isUnderwater()) + rty;
if(placer.isCarved(i, h, ii) || placer.isCarved(i, h - 1, ii) || placer.isCarved(i, h - 2, ii) || placer.isCarved(i, h - 3, ii)) {
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) || placer.isCarved(i, h - 1, j) || placer.isCarved(i, h - 2, j) || placer.isCarved(i, h - 3, j)) {
bail = true;
break;
}
if(h < y)
if(h < y) {
y = h;
}
}
}
} else if(config.getMode().equals(ObjectPlaceMode.FAST_MIN_HEIGHT)) {