From 6d6bd4f054d08c913cb8231188325fc80e256686 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 31 Oct 2026 00:43:10 -0500 Subject: [PATCH] Keep a pack's side faces on hanging vines DecoratorCore.fixFacesForHunk cleared every face of a placed vine and re-attached it to solid neighbours, falling back to UP. A ceiling decorator that stacks vines downward therefore made a flat sheet under every block instead of a hanging curtain, whatever faces the pack set. When the pack already gives a vine a side face, keep it (the vine above holds it, as in vanilla) and add UP only where a solid ceiling is directly above. Vines without authored side faces are fixed as before. --- .../generation/decoration/DecoratorCore.java | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/core/src/main/java/art/arcane/iris/generation/decoration/DecoratorCore.java b/core/src/main/java/art/arcane/iris/generation/decoration/DecoratorCore.java index 8cee6de8e..905dbb137 100644 --- a/core/src/main/java/art/arcane/iris/generation/decoration/DecoratorCore.java +++ b/core/src/main/java/art/arcane/iris/generation/decoration/DecoratorCore.java @@ -457,40 +457,21 @@ final class DecoratorCore { BlockData rawB = (BlockData) b.nativeHandle(); BlockData cloned = rawB.clone(); MultipleFacing data = (MultipleFacing) cloned; + if (data.getFaces().stream().anyMatch(f -> f != BlockFace.UP && f != BlockFace.DOWN)) { + // The pack chose which side a hanging strand faces: keep it (the vine above holds it up), and tie the + // block under a solid ceiling to it, so ceiling decorators hang curtains instead of flat ceiling sheets. + if (data.getAllowedFaces().contains(BlockFace.UP) && sturdy(BlockFace.UP, hunk, rX, rZ, x, y, z, mantle)) { + data.setFace(BlockFace.UP, true); + } + return BukkitBlockState.of(cloned); + } data.getFaces().forEach(f -> data.setFace(f, false)); boolean found = false; for (BlockFace f : BlockFace.values()) { - if (!f.isCartesian()) { - continue; - } - int yy = y + f.getModY(); - - NativeBlockState rs = null; - if (mantle != null) { - rs = mantle.getMantle().get(x + f.getModX(), yy, z + f.getModZ(), NativeBlockState.class); - } - BlockData r = rs == null ? (BlockData) EngineMantle.AIR.get().nativeHandle() : (BlockData) rs.nativeHandle(); - if (r.isFaceSturdy(f.getOppositeFace(), BlockSupport.FULL)) { - if (data.getAllowedFaces().contains(f)) { - found = true; - data.setFace(f, true); - } - continue; - } - - int xx = rX + f.getModX(); - int zz = rZ + f.getModZ(); - if (xx < 0 || xx > 15 || zz < 0 || zz > 15 || yy < 0 || yy >= hunk.getHeight()) { - continue; - } - - r = (BlockData) hunk.get(xx, yy, zz).nativeHandle(); - if (r.isFaceSturdy(f.getOppositeFace(), BlockSupport.FULL)) { - if (data.getAllowedFaces().contains(f)) { - found = true; - data.setFace(f, true); - } + if (f.isCartesian() && sturdy(f, hunk, rX, rZ, x, y, z, mantle) && data.getAllowedFaces().contains(f)) { + found = true; + data.setFace(f, true); } } if (!found) { @@ -502,6 +483,22 @@ final class DecoratorCore { return BukkitBlockState.of(cloned); } + /** Whether the neighbour on that face (mantle first, then this chunk's hunk) offers a full sturdy face to attach to. */ + private static boolean sturdy(BlockFace f, Hunk hunk, int rX, int rZ, int x, int y, int z, EngineMantle mantle) { + int yy = y + f.getModY(); + NativeBlockState rs = mantle == null ? null : mantle.getMantle().get(x + f.getModX(), yy, z + f.getModZ(), NativeBlockState.class); + BlockData r = rs == null ? (BlockData) EngineMantle.AIR.get().nativeHandle() : (BlockData) rs.nativeHandle(); + if (r.isFaceSturdy(f.getOppositeFace(), BlockSupport.FULL)) { + return true; + } + int xx = rX + f.getModX(); + int zz = rZ + f.getModZ(); + if (xx < 0 || xx > 15 || zz < 0 || zz > 15 || yy < 0 || yy >= hunk.getHeight()) { + return false; + } + return ((BlockData) hunk.get(xx, yy, zz).nativeHandle()).isFaceSturdy(f.getOppositeFace(), BlockSupport.FULL); + } + static boolean canGoOn(NativeBlockState decorator, NativeBlockState surface) { if (!B.canPlaceOnto(decorator, surface)) { return false;