From 57d5e46713e8d25428049bf5099317f06fc7f41f Mon Sep 17 00:00:00 2001 From: char <45241413+char3210@users.noreply.github.com> Date: Fri, 21 Feb 2025 21:39:57 -0600 Subject: [PATCH] fix fortress generation --- .../structure/FortressGenerator.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/seedfinding/mcfeature/structure/generator/structure/FortressGenerator.java b/src/main/java/com/seedfinding/mcfeature/structure/generator/structure/FortressGenerator.java index 957f347..6dd8258 100644 --- a/src/main/java/com/seedfinding/mcfeature/structure/generator/structure/FortressGenerator.java +++ b/src/main/java/com/seedfinding/mcfeature/structure/generator/structure/FortressGenerator.java @@ -438,11 +438,15 @@ private boolean intersectsAny(int xMin, int yMin, int zMin, int xMax, int yMax, } private void setSeed(ChunkRand rand, long worldSeed, int chunkX, int chunkZ) { - rand.setSeed((chunkX >> 4) ^ (chunkZ >> 4 << 4) ^ worldSeed); - rand.nextInt(); - rand.nextInt(3); - rand.nextInt(8); - rand.nextInt(8); + if (version.isOlderOrEqualTo(MCVersion.v1_15)) { + rand.setSeed((chunkX >> 4) ^ (chunkZ >> 4 << 4) ^ worldSeed); + rand.nextInt(); + rand.nextInt(3); + rand.nextInt(8); + rand.nextInt(8); + } else { + rand.setCarverSeed(worldSeed, chunkX, chunkZ, version); + } } public static void main(String[] args) { @@ -487,12 +491,12 @@ private interface Extender { void extend(PieceInfo pieceInfo, ChunkRand rand); } - private static class PieceInfo { - private final int type; - private final int depth; - private final int xMin, yMin, zMin; - private final int xMax, yMax, zMax; - private final int facing; + public static class PieceInfo { + public final int type; + public final int depth; + public final int xMin, yMin, zMin; + public final int xMax, yMax, zMax; + public final int facing; public PieceInfo(int type, int depth, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, int facing) { this.type = type;