From 0d8f0a86bdce3d7f833979ff0bba175132d4447e Mon Sep 17 00:00:00 2001 From: makamys Date: Fri, 27 Oct 2023 22:15:49 +0200 Subject: [PATCH] Fix LUMINA incompat (cc #19) --- src/main/java/makamys/coretweaks/Compat.java | 4 ++++ src/main/java/makamys/coretweaks/Config.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/makamys/coretweaks/Compat.java b/src/main/java/makamys/coretweaks/Compat.java index bcc9e44..c87ff30 100644 --- a/src/main/java/makamys/coretweaks/Compat.java +++ b/src/main/java/makamys/coretweaks/Compat.java @@ -56,6 +56,10 @@ public static boolean isNotFinePresent() { return Config.class.getResource("/jss/notfine/NotFine.class") != null; } + public static boolean isLuminaPresent() { + return Config.class.getResource("/com/falsepattern/lumina/api/LumiAPI.class") != null; + } + private static String getModVersion(String className) { String path = "/" + className.replace('.', '/') + ".class"; try(InputStream is = Compat.class.getResourceAsStream(path)) { diff --git a/src/main/java/makamys/coretweaks/Config.java b/src/main/java/makamys/coretweaks/Config.java index fe5db9c..4f80e48 100644 --- a/src/main/java/makamys/coretweaks/Config.java +++ b/src/main/java/makamys/coretweaks/Config.java @@ -58,7 +58,7 @@ public class Config { public static CloudHeightCheck cloudHeightCheckMode; @ConfigWrappedEnum(cat="Bugfixes", def=TRUE, com="Fixes graphical glitches that happen after recovering from a game crash, caused by world renderer display lists getting deleted but never reallocated. From 1.12.") public static FeatureSetting fixDisplayListDelete; - @ConfigWrappedEnum(cat="Bugfixes", def=TRUE, com="Fixes heightmap calculation not including the top layer of 16x16x16 regions, causing lighting errors (MC-7508)") + @ConfigWrappedEnum(cat="Bugfixes", def=TRUE, com="Fixes heightmap calculation not including the top layer of 16x16x16 regions, causing lighting errors (MC-7508)\nCompatibility note: Not compatible with LUMINA, which ostensibly accomplishes the same thing (this feature will be disabled).") public static FeatureSetting fixHeightmapRange; @ConfigWrappedEnum(cat="Bugfixes", def=TRUE, com="Fixes an extra food item sometimes getting silently consumed (MC-849)") public static FeatureSetting fixDoubleEat; @@ -363,6 +363,11 @@ private static boolean shouldDisable(FeatureSetting feature) { LOGGER.info("Disabling cloud height check fix because NotFine is present."); return true; } + } else if(feature == fixHeightmapRange) { + if(Compat.isLuminaPresent()) { + LOGGER.info("Disabling heightmap range fix because LUMINA is present."); + return true; + } } return false; }