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