From ff184c1da6359ebe57cffa894c64414c1b13f435 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com> Date: Sun, 31 Aug 2025 11:55:49 +0800 Subject: [PATCH] Modify end void rings generation (#722) * Modify end void rings generation * move to fix * fix up --------- Co-authored-by: MC_XiaoHei --- ...141-Modify-end-void-rings-generation.patch | 19 +++++++++++++++++++ .../org/leavesmc/leaves/LeavesConfig.java | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 leaves-server/minecraft-patches/features/0141-Modify-end-void-rings-generation.patch diff --git a/leaves-server/minecraft-patches/features/0141-Modify-end-void-rings-generation.patch b/leaves-server/minecraft-patches/features/0141-Modify-end-void-rings-generation.patch new file mode 100644 index 00000000..03db30b5 --- /dev/null +++ b/leaves-server/minecraft-patches/features/0141-Modify-end-void-rings-generation.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Helvetica Volubi +Date: Tue, 26 Aug 2025 03:14:04 +0800 +Subject: [PATCH] Modify end void rings generation + + +diff --git a/net/minecraft/world/level/levelgen/DensityFunctions.java b/net/minecraft/world/level/levelgen/DensityFunctions.java +index 04527a5c65ad630f794fed9071d485aedd02257a..0298ba0c68447c5d0d555431b3118552b3d90a34 100644 +--- a/net/minecraft/world/level/levelgen/DensityFunctions.java ++++ b/net/minecraft/world/level/levelgen/DensityFunctions.java +@@ -528,7 +528,7 @@ public final class DensityFunctions { + 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 = org.leavesmc.leaves.LeavesConfig.fix.vanillaEndVoidRings ? 100.0F - Mth.sqrt(x * x + z * z) * 8.0F : 100.0F - Mth.sqrt((long)x * (long)x + (long)z * (long)z) * 8.0F; // Paper - cast ints to long to avoid integer overflow // Leaves - customize end void rings generation + f = Mth.clamp(f, -100.0F, 80.0F); + + NoiseCache cache = noiseCache.get().computeIfAbsent(noise, noiseKey -> new NoiseCache()); // Paper - Perf: Optimize end generation diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java index 8c2f7746..cb314cdf 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java @@ -1237,5 +1237,8 @@ public final class LeavesConfig { public enum CollisionBehavior { VANILLA, BLOCK_SHAPE_VANILLA, PAPER } + + @GlobalConfig("vanilla-end-void-rings") + public boolean vanillaEndVoidRings = false; } }