Fix forge on Java 16 and higher.

This commit is contained in:
Username404-59 2021-04-08 18:36:45 +02:00
parent 95af7d7cb8
commit d14c7c94aa
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 14 additions and 1 deletions

View File

@ -4,4 +4,17 @@ dependencies {
implementation(project(path = ":common")) { isTransitive = false }
add("developmentForge", project(path = ":common")) { isTransitive = false }
shadowC(project(path = ":common", configuration = "transformProductionForge")) { isTransitive = false }
}; loom { useFabricMixin = true }
}; loom {
useFabricMixin = true
if (JavaVersion.current().isJava9Compatible) {
runs {
val args: List<String> = listOf("--illegal-access=permit")
if (JavaVersion.current() < JavaVersion.VERSION_17) {
listOf("--add-exports java.base/sun.security.util=ALL-UNNAMED", "--add-opens java.base/java.util.jar=ALL-UNNAMED")
}
this.forEach {
it.vmArgs(args)
}
}
}
}