diff --git a/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch new file mode 100644 index 0000000..e7e8709 --- /dev/null +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch @@ -0,0 +1,25 @@ +--- a/net/minecraft/world/level/levelgen/SurfaceRules.java ++++ b/net/minecraft/world/level/levelgen/SurfaceRules.java +@@ -397,6 +_,22 @@ + + @Override + protected boolean compute() { ++ // DivineMC start - Fix MC-258859 ++ if (org.bxteam.divinemc.DivineConfig.slopesVisualFix) { ++ int x = this.context.blockX & 15; ++ int z = this.context.blockZ & 15; ++ ChunkAccess chunk = this.context.chunk; ++ int south = chunk.getHeight(Heightmap.Types.WORLD_SURFACE_WG, x, Math.max(z - 1, 0)); ++ int north = chunk.getHeight(Heightmap.Types.WORLD_SURFACE_WG, x, Math.min(z + 1, 15)); ++ if (Math.abs(north - south) >= 4) { ++ return true; ++ } else { ++ int west = chunk.getHeight(Heightmap.Types.WORLD_SURFACE_WG, Math.max(x - 1, 0), z); ++ int east = chunk.getHeight(Heightmap.Types.WORLD_SURFACE_WG, Math.min(x + 1, 15), z); ++ return Math.abs(west - east) >= 4; ++ } ++ } ++ // DivineMC end - Fix MC-258859 + int i = this.context.blockX & 15; + int i1 = this.context.blockZ & 15; + int max = Math.max(i1 - 1, 0); diff --git a/divinemc-server/src/main/java/org/bxteam/divinemc/DivineConfig.java b/divinemc-server/src/main/java/org/bxteam/divinemc/DivineConfig.java index 92a99c0..2932a0b 100644 --- a/divinemc-server/src/main/java/org/bxteam/divinemc/DivineConfig.java +++ b/divinemc-server/src/main/java/org/bxteam/divinemc/DivineConfig.java @@ -174,6 +174,7 @@ public class DivineConfig { public static int threadPoolPriority = Thread.NORM_PRIORITY + 1; public static boolean enableSecureSeed = false; public static boolean smoothBedrockLayer = false; + public static boolean slopesVisualFix = false; public static boolean enableDensityFunctionCompiler = false; public static boolean enableStructureLayoutOptimizer = true; public static boolean deduplicateShuffledTemplatePoolElementList = false; @@ -213,6 +214,8 @@ public class DivineConfig { smoothBedrockLayer = getBoolean("settings.chunk-generation.smooth-bedrock-layer", smoothBedrockLayer, "Smoothens the bedrock layer at the bottom of overworld, and on the top of nether during the world generation."); + slopesVisualFix = getBoolean("settings.chunk-generation.slopes-visual-fix", slopesVisualFix, + "Fixes MC-258859, fixing slopes visual bug in biomes like Snowy Slopes, Frozen Peaks, Jagged Peaks, and including Terralith."); enableDensityFunctionCompiler = getBoolean("settings.chunk-generation.experimental.enable-density-function-compiler", enableDensityFunctionCompiler, "Whether to use density function compiler to accelerate world generation",