diff --git a/src/main/java/com/seibel/lod/core/ModInfo.java b/src/main/java/com/seibel/lod/core/ModInfo.java index 84d4f19bc..c19fdd6f7 100644 --- a/src/main/java/com/seibel/lod/core/ModInfo.java +++ b/src/main/java/com/seibel/lod/core/ModInfo.java @@ -19,6 +19,8 @@ package com.seibel.lod.core; +import java.util.Locale; + /** * This file is similar to mcmod.info *
@@ -29,7 +31,7 @@ package com.seibel.lod.core; * * @author James Seibel * @author Ran - * @version 2022-4-25 + * @version 2022-4-27 */ public final class ModInfo { @@ -41,10 +43,13 @@ public final class ModInfo /** Human readable version of NAME */ public static final String READABLE_NAME = "Distant Horizons"; public static final String VERSION = "1.7.0a-dev"; + /** Returns true if the current build is an unstable developer build, false otherwise. */ + public static boolean IS_DEV_BUILD = VERSION.toLowerCase().contains("dev"); /** This version should only be updated when breaking changes are introduced to the DH API */ public static final int API_MAJOR_VERSION = 1; /** This version should be updated whenever new methods are added to the DH API */ public static final int API_MINOR_VERSION = 1; + } diff --git a/src/main/java/com/seibel/lod/core/api/external/ApiMain.java b/src/main/java/com/seibel/lod/core/api/external/ApiMain.java index f8f5ace49..de57fefe6 100644 --- a/src/main/java/com/seibel/lod/core/api/external/ApiMain.java +++ b/src/main/java/com/seibel/lod/core/api/external/ApiMain.java @@ -8,7 +8,7 @@ import com.seibel.lod.core.handlers.LodDimensionFileHandler; * This shouldn't change between API versions. * * @author James Seibel - * @version 2022-4-26 + * @version 2022-4-27 */ public class ApiMain { @@ -31,7 +31,7 @@ public class ApiMain /** Returns true if the mod is a development version, false if it is a release version. */ public static boolean getIsDevVersion() { - return #if DEV_BUILD true; #else false; #endif + return ModInfo.IS_DEV_BUILD; } /** Returns the network protocol version. */ diff --git a/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java b/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java index 2d72ab197..ab5886e37 100644 --- a/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java +++ b/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java @@ -58,7 +58,7 @@ import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper; * Specifically for the client. * * @author James Seibel - * @version 2022-4-26 + * @version 2022-4-27 */ public class ClientApi { @@ -153,11 +153,11 @@ public class ClientApi public void renderLods(Mat4f mcModelViewMatrix, Mat4f mcProjectionMatrix, float partialTicks) { - #if DEV_BUILD - // config overrides should only be used in the developer builds - applyDeveloperConfigOverrides(); - #endif - + if (ModInfo.IS_DEV_BUILD) + { + // config overrides should only be used in the developer builds + applyDeveloperConfigOverrides(); + } // clear any out of date objects MC.clearFrameObjectCache();