diff options
author | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-06-11 11:16:01 +0100 |
---|---|---|
committer | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-06-11 11:16:01 +0100 |
commit | 6239cf215a789a21e702cb793706ca0fa5a4bcca (patch) | |
tree | 6cc87eb30fe4606d54481b955dc76e6861299d9d /src/main/java/cc/polyfrost/oneconfig/internal | |
parent | 1ab7422957a76158883e0449ed593ac216c9ef80 (diff) | |
download | OneConfig-6239cf215a789a21e702cb793706ca0fa5a4bcca.tar.gz OneConfig-6239cf215a789a21e702cb793706ca0fa5a4bcca.tar.bz2 OneConfig-6239cf215a789a21e702cb793706ca0fa5a4bcca.zip |
Slideyboi, a couple fixes, replace print calls and test feature
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java | 16 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java | 5 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java index b3c6823..5f3b669 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java @@ -15,6 +15,8 @@ import net.minecraftforge.fml.common.DummyModContainer; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.ModContainer; import net.minecraftforge.fml.common.ModMetadata; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.io.File; import java.util.ArrayList; @@ -29,9 +31,11 @@ public class OneConfig { public static final File oneConfigDir = new File("./OneConfig"); public static final List<Mod> loadedMods = new ArrayList<>(); public static final List<ModMetadata> loadedOtherMods = new ArrayList<>(); + public static final Logger LOGGER = LogManager.getLogger("@NAME@"); public static OneConfigConfig config; private static boolean preLaunched = false; private static boolean initialized = false; + private static boolean isObfuscated = true; /** * Called before mods are loaded. @@ -39,6 +43,12 @@ public class OneConfig { */ public static void preLaunch() { if (preLaunched) return; + try { + OneConfig.class.getResourceAsStream("net/minecraft/world/World"); + LOGGER.warn("OneConfig is NOT obfuscated!"); + isObfuscated = false; + } catch (Exception ignored) { + } if (!net.minecraft.launchwrapper.Launch.blackboard.containsKey("oneconfig.initialized")) { throw new RuntimeException("OneConfig has not been initialized! Please add the OneConfig tweaker or call OneConfigInit via an ITweaker or a FMLLoadingPlugin!"); } @@ -77,4 +87,10 @@ public class OneConfig { if (modData.add(newMod)) loadedMods.add(newMod); } } + + /** Returns weather this is an obfuscated environment, using a check for obfuscated name of net.minecraft.world.World.class. + * @return true if this is an obfuscated environment, which is normal for Minecraft or false if not. */ + public static boolean isObfuscated() { + return isObfuscated; + } } diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java b/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java index a8d1e72..49a4ca3 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java @@ -15,6 +15,7 @@ public class Colors { public static final int GRAY_500 = new Color(49, 51, 56, 255).getRGB(); // Gray 500 // button sidebar hover, button gray normal public static final int GRAY_500_80 = new Color(49, 51, 56, 204).getRGB(); // Gray 500 80% // button sidebar pressed public static final int GRAY_400 = new Color(55, 59, 69, 255).getRGB(); // Gray 400 + public static final int GRAY_400_60 = new Color(55, 59, 69, 153).getRGB(); // Gray 400 60% public static final int GRAY_300 = new Color(73, 79, 92, 255).getRGB(); // Gray 300 // button gray hover public static final int GRAY_400_80 = new Color(55, 59, 69, 204).getRGB(); // Gray 400 80% // button gray pressed public static final int PRIMARY_800 = new Color(13, 51, 128, 255).getRGB(); // Blue 800 @@ -23,11 +24,11 @@ public class Colors { public static final int PRIMARY_600 = new Color(20, 82, 204, 255).getRGB(); // Blue 600 // button blue normal public static final int PRIMARY_500 = new Color(25, 103, 255, 255).getRGB(); // Blue 500 // button blue hover public static final int PRIMARY_400 = new Color(48, 129, 242, 255).getRGB(); - public static final int WHITE_50 = new Color(255, 255, 255, 127).getRGB(); // White 60% + public static final int WHITE_50 = new Color(255, 255, 255, 127).getRGB(); // White 50% public static final int WHITE_60 = new Color(255, 255, 255, 153).getRGB(); // White 60% public static final int WHITE_80 = new Color(255, 255, 255, 204).getRGB(); // White 80% public static final int WHITE_90 = new Color(255, 255, 255, 229).getRGB(); // White 90% - public static final int WHITE_95 = new Color(255, 255, 255, 242).getRGB(); // White 90% + public static final int WHITE_95 = new Color(255, 255, 255, 242).getRGB(); // White 95% public static final int WHITE = new Color(255, 255, 255, 255).getRGB(); // White 100% public static final int SUCCESS_600 = new Color(3, 152, 85).getRGB(); public static final int SUCCESS_700 = new Color(2, 121, 72).getRGB(); |