9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-22 08:19:19 +00:00

Fix MC-258859

This commit is contained in:
NONPLAYT
2025-03-06 00:46:33 +03:00
parent d494fe0e28
commit 1c61d697f0
2 changed files with 28 additions and 0 deletions

View File

@@ -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);

View File

@@ -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",