Add configuration setting to re-add End void rings (#1656)

Co-authored-by: granny <granny@purpurmc.org>
This commit is contained in:
linaTetris
2025-05-03 19:32:59 -04:00
committed by GitHub
parent 8c77678e81
commit 93011bc195
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/world/level/levelgen/DensityFunctions.java
+++ b/net/minecraft/world/level/levelgen/DensityFunctions.java
@@ -528,7 +_,7 @@
int i1 = z / 2;
int i2 = x % 2;
int i3 = z % 2;
- float f = 100.0F - Mth.sqrt((long)x * (long)x + (long)z * (long)z) * 8.0F; // Paper - cast ints to long to avoid integer overflow
+ float f = 100.0F - Mth.sqrt(org.purpurmc.purpur.PurpurConfig.generateEndVoidRings ? x * x + z * z : (long)x * (long)x + (long)z * (long)z) * 8.0F; // Paper - cast ints to long to avoid integer overflow // Purpur - Setting to reintroduce end void rings
f = Mth.clamp(f, -100.0F, 80.0F);
NoiseCache cache = noiseCache.get().computeIfAbsent(noise, noiseKey -> new NoiseCache()); // Paper - Perf: Optimize end generation

View File

@@ -610,4 +610,9 @@ public class PurpurConfig {
startupCommands.add(command);
});
}
public static boolean generateEndVoidRings = false;
private static void generateEndVoidRings() {
generateEndVoidRings = getBoolean("settings.generate-end-void-rings", generateEndVoidRings);
}
}