Skip to content

Commit

Permalink
Actually fix the kotlin issue
Browse files Browse the repository at this point in the history
MHUtils still cant be used though because nothing in the tweaker should be calling real oneconfig classes
  • Loading branch information
Wyvest committed Jan 3, 2025
1 parent d9fc803 commit 85e8b95
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name=OneConfig
mod_id=oneconfig
version_major=1
version_minor=0
version_patch=0-alpha.50
version_patch=0-alpha.51

polyfrost.defaults.loom=3

Expand Down
12 changes: 8 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@ nightconfig-yaml = { module = "com.electronwill.night-config:yaml", version.ref
nightconfig-json = { module = "com.electronwill.night-config:json", version.ref = "nightconfig" }

kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "kotlinx-coroutines" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "kotlinx-coroutines" }
kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu-jvm", version.ref = "kotlinx-atomicfu" }
fabric-language-kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric-language-kotlin" }

[bundles]
kotlin = ["kotlin-reflect", "kotlin-stdlib"]
kotlinx = ["kotlinx-coroutines", "kotlinx-atomicfu"]
kotlin = ["kotlin-reflect", "kotlin-stdlib", "kotlin-stdlib-jdk7", "kotlin-stdlib-jdk8"]
kotlinx = ["kotlinx-coroutines", "kotlinx-coroutines-jvm", "kotlinx-coroutines-jdk8", "kotlinx-atomicfu"]
lwjgl = ["lwjgl", "lwjgl-nvg", "lwjgl-opengl", "lwjgl-stb", "lwjgl-tinyfd"]
nightconfig = ["nightconfig", "nightconfig-json", "nightconfig-toml", "nightconfig-yaml"]
test-core = ["junit", "logging-impl"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import net.minecraftforge.fml.relauncher.CoreModManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.polyfrost.oneconfig.api.platform.v1.Platform;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;

Expand Down Expand Up @@ -76,7 +75,7 @@ public OneConfigTweaker() {
LOGGER.error("failed to setup mixin for {}", sourceFile.path.toString(), t);
}
}
} else if (!Platform.loader().isDevelopmentEnvironment()) {
} else if (!isDevelopmentEnvironment()) {
LOGGER.fatal("Not able to detect jar sources. mixin will NOT work!");
}

Expand Down Expand Up @@ -262,6 +261,11 @@ public String[] getLaunchArguments() {
return new String[0];
}

private static boolean isDevelopmentEnvironment() {
Object o = Launch.blackboard.get("fml.deobfuscatedEnvironment");
return o != null && (boolean) o;
}

private static class SourceFile {
final Path path;
final String coreMod;
Expand Down

0 comments on commit 85e8b95

Please sign in to comment.