Skip to content

Commit 492a315

Browse files
committed
Fix: Forge dev env
1 parent af8c6a1 commit 492a315

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

common/src/main/kotlin/com/lambda/common/Lambda.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object Lambda {
1616
private val VERSION: String = LoaderInfo.getVersion()
1717

1818
val LOG: Logger = LogManager.getLogger(SYMBOL)
19-
val mc: MinecraftClient = MinecraftClient.getInstance()
19+
val mc: MinecraftClient by lazy { MinecraftClient.getInstance() }
2020

2121
init {
2222
listener<KeyPressEvent> {

forge/build.gradle.kts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ base.archivesName.set("${base.archivesName.get()}-forge")
1111

1212
loom {
1313
accessWidenerPath.set(project(":common").loom.accessWidenerPath)
14+
1415
forge {
1516
convertAccessWideners = true
1617
extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name)
1718
mixinConfig("lambda.mixins.common.json")
1819
}
20+
21+
mods {
22+
register("forge") {
23+
sourceSet("main", project(":forge"))
24+
}
25+
}
1926
}
2027

2128
repositories {
@@ -49,19 +56,18 @@ dependencies {
4956
forge("net.minecraftforge:forge:$forgeVersion")
5057

5158
// Add dependencies on the required Kotlin modules.
52-
includeLib("io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion")
53-
includeLib("thedarkcolour:kotlinforforge:$kotlinForgeVersion")
59+
includeLib("thedarkcolour:kotlinforforge:$kotlinForgeVersion") { isTransitive = false }
60+
includeLib("io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion") { isTransitive = false }
5461

5562
// Add mods to the mod jar
56-
// includeMod(...)
63+
includeMod("thedarkcolour:kotlinforforge:$kotlinForgeVersion") // Both a library and a mod
64+
65+
compileOnly(kotlin("stdlib")) // Hacky fix https://github.com/thedarkcolour/KotlinForForge/issues/93
5766

5867
// Common (Do not touch)
59-
common(project(":common", configuration = "namedElements")) { isTransitive = false }
68+
implementation(project(":common", configuration = "namedElements")) { isTransitive = false } // We cannot common here because it is treated as a different mod and forge will panic
6069
shadowCommon(project(path = ":common", configuration = "transformProductionForge")) { isTransitive = false }
6170

62-
// KFF Fix
63-
compileOnly(kotlin("stdlib")) // Hacky fix https://github.com/thedarkcolour/KotlinForForge/issues/93
64-
6571
// Finish the configuration
6672
setupConfigurations()
6773
}

0 commit comments

Comments
 (0)