From f81cee245495975638ac4b65a01741ae072cabbe Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 26 Aug 2025 03:04:39 +0800 Subject: [PATCH] feat: add a config to revert MC-159283 --- ...-to-allow-to-generate-end-void-rings.patch | 19 +++++++++++++++++++ .../modules/gameplay/EndVoidRingsConfig.java | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 lophine-server/minecraft-patches/features/0019-Add-config-to-allow-to-generate-end-void-rings.patch create mode 100644 lophine-server/src/main/java/fun/bm/lophine/config/modules/gameplay/EndVoidRingsConfig.java diff --git a/lophine-server/minecraft-patches/features/0019-Add-config-to-allow-to-generate-end-void-rings.patch b/lophine-server/minecraft-patches/features/0019-Add-config-to-allow-to-generate-end-void-rings.patch new file mode 100644 index 0000000..1342961 --- /dev/null +++ b/lophine-server/minecraft-patches/features/0019-Add-config-to-allow-to-generate-end-void-rings.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Helvetica Volubi +Date: Tue, 26 Aug 2025 02:55:23 +0800 +Subject: [PATCH] Add config to allow to generate end void rings + + +diff --git a/net/minecraft/world/level/levelgen/DensityFunctions.java b/net/minecraft/world/level/levelgen/DensityFunctions.java +index 04527a5c65ad630f794fed9071d485aedd02257a..ed4408e6a98b12b91382d23fdfeeb69c6926d038 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 = fun.bm.lophine.config.modules.gameplay.EndVoidRingsConfig.enabled ? 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 // Lophine - optimize 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/lophine-server/src/main/java/fun/bm/lophine/config/modules/gameplay/EndVoidRingsConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/gameplay/EndVoidRingsConfig.java new file mode 100644 index 0000000..e9d9676 --- /dev/null +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/gameplay/EndVoidRingsConfig.java @@ -0,0 +1,13 @@ +package fun.bm.lophine.config.modules.gameplay; + +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; +import me.earthme.luminol.config.flags.ConfigClassInfo; +import me.earthme.luminol.config.flags.ConfigInfo; + +@ConfigClassInfo(configAttribution = EnumConfigCategory.GAMEPLAY, mainName = "end-void-ring") +public class EndVoidRingsConfig implements IConfigModule { + @ConfigInfo(baseName = "enabled", comments = """ + If enabled, it will generate end void rings, like MC-159283.""") + public static boolean enabled = false; +}