Added stilt override.

This commit is contained in:
Vatuu 2022-06-12 08:10:07 +02:00
parent 246e974dc1
commit 9dd20661f5
No known key found for this signature in database
GPG Key ID: C6F07B79B2ED9150
2 changed files with 12 additions and 4 deletions

View File

@ -574,10 +574,16 @@ public class IrisObject extends IrisRegistrant {
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();
for(int i = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i <= x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i++) { int xLength = (rotatedDimensions.getBlockX() / 2) + offset.getBlockX();
for(int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j++) { int minX = Math.min(x - xLength, x + xLength);
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty; int maxX = Math.max(x - xLength, x + xLength);
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 zLength = (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ();
int minZ = Math.min(z - zLength, z + zLength);
int maxZ = Math.max(z - zLength, z + zLength);
for(int i = minX; i <= maxX; i++) {
for(int ii = minZ; ii <= maxZ; 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;
} }

View File

@ -79,6 +79,8 @@ public class IrisObjectPlacement {
@MinNumber(0) @MinNumber(0)
@Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.") @Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.")
private int overStilt = 0; private int overStilt = 0;
@Desc("If defined, stilting will be done using this block rather than the last layer of the object.")
private IrisBlockData stiltOverride;
@MaxNumber(64) @MaxNumber(64)
@MinNumber(0) @MinNumber(0)
@Desc("When bore is enabled, expand max-y of the cuboid it removes") @Desc("When bore is enabled, expand max-y of the cuboid it removes")