diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java b/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java index e7db84ff3..6bd52f0a9 100644 --- a/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java +++ b/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java @@ -65,6 +65,8 @@ public class IrisJigsawPiece extends IrisRegistrant }); } + + public IrisJigsawPieceConnector getConnector(IrisPosition relativePosition) { for(IrisJigsawPieceConnector i : connectors) { diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java b/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java index 1bd276963..92070520c 100644 --- a/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java +++ b/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java @@ -31,6 +31,10 @@ public class IrisJigsawStructure extends IrisRegistrant @Desc("The maximum pieces that can step out from the center piece") private int maxDepth = 9; + @DontObfuscate + @Desc("Jigsaw grows the parallax layer which slows iris down a bit. Since there are so many pieces, Iris takes the avg piece size and calculates the parallax radius from that. Unless your structures are using only the biggest pieces, your structure should fit in the chosen size fine. If you are seeing cut-off parts of your structures or broken terrain, turn this option on. This option will pick the biggest piece dimensions and multiply it by your (maxDepth+1) * 2 as the size to grow the parallax layer by. But typically kepp this off.") + private boolean useMaxPieceSizeForParallaxRadius = false; + @Desc("Add a noise feature to this village") @DontObfuscate private IrisFeature feature = null; @@ -85,21 +89,45 @@ public class IrisJigsawStructure extends IrisRegistrant public int getMaxDimension() { return maxDimension.aquire(() -> { - int max = 0; - KList pools = new KList<>(); - KList pieces = new KList<>(); - - for(String i : getPieces()) + if(useMaxPieceSizeForParallaxRadius) { - loadPiece(i, pools, pieces); + int max = 0; + KList pools = new KList<>(); + KList pieces = new KList<>(); + + for(String i : getPieces()) + { + loadPiece(i, pools, pieces); + } + + for(String i : pieces) + { + max = Math.max(max, getLoader().getJigsawPieceLoader().load(i).getMax3dDimension()); + } + + return max * (((getMaxDepth() + 1) * 2) + 1); } - for(String i : pieces) + else { - max = Math.max(max, getLoader().getJigsawPieceLoader().load(i).getMax3dDimension()); - } + int max = 0; + KList pools = new KList<>(); + KList pieces = new KList<>(); - return max * (((getMaxDepth() + 1) * 2) + 1); + for(String i : getPieces()) + { + loadPiece(i, pools, pieces); + } + + int avg = 0; + + for(String i : pieces) + { + avg += getLoader().getJigsawPieceLoader().load(i).getMax2dDimension(); + } + + return (avg/pieces.size()) * (((getMaxDepth() + 1) * 2) + 1); + } }); } }