From d5699a7472875b070ca9c415e715a5360025c0f9 Mon Sep 17 00:00:00 2001 From: Vatuu <21113232+Vatuu@users.noreply.github.com> Date: Sun, 22 May 2022 03:22:19 +0200 Subject: [PATCH] Totally didn't replace MIN_HEIGHT instead of FAST_MAX_HEIGHT :skull: --- .../volmit/iris/engine/object/IrisObject.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/volmit/iris/engine/object/IrisObject.java b/src/main/java/com/volmit/iris/engine/object/IrisObject.java index e33203bf9..a2695dbd7 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisObject.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisObject.java @@ -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)) {