From 5a4ca2f907e4a5cb33d2232f2a80bdae477473b2 Mon Sep 17 00:00:00 2001 From: Vatuu <21113232+Vatuu@users.noreply.github.com> Date: Mon, 16 May 2022 17:49:49 +0200 Subject: [PATCH] Fixed stilting with edited data. --- .../volmit/iris/engine/object/IrisObject.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 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 8494e881c..1a033aeb4 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisObject.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisObject.java @@ -820,13 +820,27 @@ public class IrisObject extends IrisRegistrant { i = config.getRotation().rotate(i.clone(), spinx, spiny, spinz).clone(); i = config.getTranslate().translate(i.clone(), config.getRotation(), spinx, spiny, spinz).clone(); - if(i.getBlockY() != lowest) { + if(i.getBlockY() != lowest) continue; + + for(IrisObjectReplace j : config.getEdit()) { + if(rng.chance(j.getChance())) { + for(BlockData k : j.getFind(rdata)) { + if(j.isExact() ? k.matches(d) : k.getMaterial().equals(d.getMaterial())) { + BlockData newData = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone(); + + if(newData.getMaterial() == d.getMaterial()) { + d = d.merge(newData); + } else { + d = newData; + } + } + } + } } - if(d == null || B.isAir(d)) { + if(d == null || B.isAir(d)) continue; - } xx = x + (int) Math.round(i.getX()); zz = z + (int) Math.round(i.getZ()); @@ -838,6 +852,10 @@ public class IrisObject extends IrisRegistrant { int yg = placer.getHighest(xx, zz, getLoader(), true); + if(config.isWaterloggable() && yg <= placer.getFluidHeight() && d instanceof Waterlogged) { + ((Waterlogged) d).setWaterlogged(true); + } + if(yv >= 0 && config.isBottom()) { y += Math.floorDiv(h, 2); } @@ -1117,7 +1135,5 @@ public class IrisObject extends IrisRegistrant { } @Override - public void scanForErrors(JSONObject p, VolmitSender sender) { - - } + public void scanForErrors(JSONObject p, VolmitSender sender) { } }