forked from mirrors/cobblemon
Make sure we don't bundle everything + handle showdown init errors better
This commit is contained in:
@@ -55,7 +55,7 @@ dependencies {
|
|||||||
// modCompileOnly(libs.flywheelFabric)
|
// modCompileOnly(libs.flywheelFabric)
|
||||||
|
|
||||||
// Showdown
|
// Showdown
|
||||||
modCompileOnly(libs.graal)
|
modCompileOnly(libs.graal.core)
|
||||||
|
|
||||||
// Data Storage
|
// Data Storage
|
||||||
modCompileOnly(libs.bundles.mongo)
|
modCompileOnly(libs.bundles.mongo)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common.battles
|
|||||||
|
|
||||||
import com.cobblemon.mod.common.Cobblemon.LOGGER
|
import com.cobblemon.mod.common.Cobblemon.LOGGER
|
||||||
import com.cobblemon.mod.common.battles.runner.ShowdownService
|
import com.cobblemon.mod.common.battles.runner.ShowdownService
|
||||||
|
import net.minecraft.CrashReport
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
|
|
||||||
@@ -37,8 +38,15 @@ class ShowdownThread : Thread("Cobblemon Showdown") {
|
|||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
LOGGER.info("Starting showdown service...")
|
LOGGER.info("Starting showdown service...")
|
||||||
ShowdownService.service.openConnection()
|
try {
|
||||||
LOGGER.info("Showdown has been started!")
|
ShowdownService.service.openConnection()
|
||||||
this.latch.countDown()
|
LOGGER.info("Showdown has been started!")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
LOGGER.error("Failed to start showdown service!", e)
|
||||||
|
} finally {
|
||||||
|
this.latch.countDown()
|
||||||
|
throw RuntimeException("Showdown service failed to initialize...")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,14 +59,13 @@ dependencies {
|
|||||||
modImplementation(libs.bundles.fabric.integrations.implementation)
|
modImplementation(libs.bundles.fabric.integrations.implementation)
|
||||||
modRuntimeOnly(libs.bundles.fabric.integrations.runtimeOnly)
|
modRuntimeOnly(libs.bundles.fabric.integrations.runtimeOnly)
|
||||||
modRuntimeOnly(libs.bundles.mongo)
|
modRuntimeOnly(libs.bundles.mongo)
|
||||||
bundle(libs.bundles.mongo)
|
|
||||||
|
|
||||||
// modImplementation(libs.flywheelFabric)
|
// modImplementation(libs.flywheelFabric)
|
||||||
// include(libs.flywheelFabric)
|
// include(libs.flywheelFabric)
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
libs.fabric.kotlin,
|
libs.fabric.kotlin,
|
||||||
libs.graal,
|
libs.bundles.graal,
|
||||||
libs.bundles.mongo
|
libs.bundles.mongo
|
||||||
).forEach {
|
).forEach {
|
||||||
include(it)
|
include(it)
|
||||||
@@ -75,7 +74,6 @@ dependencies {
|
|||||||
include(libs.fabric.kotlin)
|
include(libs.fabric.kotlin)
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
libs.graal,
|
|
||||||
libs.molang
|
libs.molang
|
||||||
).forEach {
|
).forEach {
|
||||||
bundle(it)
|
bundle(it)
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ tasks {
|
|||||||
configurations = listOf(bundle)
|
configurations = listOf(bundle)
|
||||||
mergeServiceFiles()
|
mergeServiceFiles()
|
||||||
|
|
||||||
// relocate ("com.mongodb", "com.cobblemon.mod.relocations.mongodb")
|
|
||||||
// relocate ("org.graalvm", "com.cobblemon.mod.relocations.graalvm")
|
|
||||||
relocate ("com.oracle", "com.cobblemon.mod.relocations.oracle")
|
relocate ("com.oracle", "com.cobblemon.mod.relocations.oracle")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,20 @@ blossom = "2.1.0"
|
|||||||
idea-ext = "1.1.7"
|
idea-ext = "1.1.7"
|
||||||
versioning = "3.1.0"
|
versioning = "3.1.0"
|
||||||
|
|
||||||
# Loom
|
# Minecraft Development
|
||||||
loom = "1.11-SNAPSHOT"
|
loom = "1.11-SNAPSHOT"
|
||||||
architectury-plugin = "3.4-SNAPSHOT"
|
architectury-plugin = "3.4-SNAPSHOT"
|
||||||
|
moddev = "1.0.11"
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
molang = "1.1.20"
|
molang = "1.1.20"
|
||||||
|
jei-api = "19.22.1.316"
|
||||||
|
|
||||||
|
# Graal
|
||||||
graal = "22.3.0"
|
graal = "22.3.0"
|
||||||
icu4j = "71.1"
|
icu4j = "71.1"
|
||||||
jei-api = "19.22.1.316"
|
regex = "22.3.0"
|
||||||
|
truffle = "22.3.0"
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
fabric-loader = "0.17.2"
|
fabric-loader = "0.17.2"
|
||||||
@@ -48,6 +53,7 @@ classgraph = "4.8.179"
|
|||||||
# General Buildscript Plugins
|
# General Buildscript Plugins
|
||||||
kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
|
kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||||
loom = { group = "dev.architectury", name = "architectury-loom", version.ref = "loom" }
|
loom = { group = "dev.architectury", name = "architectury-loom", version.ref = "loom" }
|
||||||
|
neoforge-moddev = { group = "net.neoforged", name = "moddev-gradle", version.ref = "moddev" }
|
||||||
architectury = { group = "architectury-plugin", name = "architectury-plugin.gradle.plugin", version.ref = "architectury-plugin" }
|
architectury = { group = "architectury-plugin", name = "architectury-plugin.gradle.plugin", version.ref = "architectury-plugin" }
|
||||||
shadow = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadow" }
|
shadow = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadow" }
|
||||||
blossom = { group = "net.kyori", name = "blossom", version.ref = "blossom" }
|
blossom = { group = "net.kyori", name = "blossom", version.ref = "blossom" }
|
||||||
@@ -62,7 +68,12 @@ kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", vers
|
|||||||
# Common
|
# Common
|
||||||
jei-api = { group = "mezz.jei", name = "jei-1.21.1-common-api", version.ref = "jei-api"}
|
jei-api = { group = "mezz.jei", name = "jei-1.21.1-common-api", version.ref = "jei-api"}
|
||||||
molang = { group = "local.com.bedrockk", name = "molang", version.ref = "molang" }
|
molang = { group = "local.com.bedrockk", name = "molang", version.ref = "molang" }
|
||||||
graal = { group = "org.graalvm.js", name = "js", version.ref = "graal" }
|
|
||||||
|
# Graal
|
||||||
|
graal-core = { group = "org.graalvm.js", name = "js", version.ref = "graal" }
|
||||||
|
graal-sdk = { group = "org.graalvm.sdk", name = "graal-sdk", version.ref = "graal" }
|
||||||
|
graal-regex = { group = "org.graalvm.regex", name = "regex", version.ref = "graal"}
|
||||||
|
graal-truffle = { group = "org.graalvm.truffle", name = "truffle-api", version.ref = "graal" }
|
||||||
icu4j = { group = "com.ibm.icu", name = "icu4j", version.ref = "icu4j" }
|
icu4j = { group = "com.ibm.icu", name = "icu4j", version.ref = "icu4j" }
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
@@ -78,7 +89,7 @@ mod-menu = { group = "com.terraformersmc", name = "modmenu", version.ref = "mod-
|
|||||||
c2me-fabric = { group = "maven.modrinth", name = "c2me-fabric", version.ref = "c2me-fabric" }
|
c2me-fabric = { group = "maven.modrinth", name = "c2me-fabric", version.ref = "c2me-fabric" }
|
||||||
|
|
||||||
# NeoForge
|
# NeoForge
|
||||||
neoforge = { group = "net.neoforged", name = "neoforge", version.ref = "neoforge" }
|
neoforge-api = { group = "net.neoforged", name = "neoforge", version.ref = "neoforge" }
|
||||||
neo-kotlin-forge = { group = "thedarkcolour", name = "kotlinforforge-neoforge", version.ref = "neo-kotlin-for-forge" }
|
neo-kotlin-forge = { group = "thedarkcolour", name = "kotlinforforge-neoforge", version.ref = "neo-kotlin-for-forge" }
|
||||||
neoforge-debugutils = { group = "maven.modrinth", name = "debugutils", version.ref = "debugutils-forge"}
|
neoforge-debugutils = { group = "maven.modrinth", name = "debugutils", version.ref = "debugutils-forge"}
|
||||||
jei-neoforge = { group = "mezz.jei", name = "jei-1.21.1-neoforge", version.ref = "jei-api"}
|
jei-neoforge = { group = "mezz.jei", name = "jei-1.21.1-neoforge", version.ref = "jei-api"}
|
||||||
@@ -104,3 +115,5 @@ fabric-integrations-runtimeOnly = [ "jei-fabric", "c2me-fabric" ]
|
|||||||
neoforge-integrations-runtimeOnly = [ "jei-neoforge", "c2me-neoforge" ]
|
neoforge-integrations-runtimeOnly = [ "jei-neoforge", "c2me-neoforge" ]
|
||||||
mongo = [ "mongo-driver-core", "mongo-driver-sync" ]
|
mongo = [ "mongo-driver-core", "mongo-driver-sync" ]
|
||||||
unitTesting = [ "junit-fabric", "junit-params", "mockito-core", "mock-kotlin", "classgraph" ]
|
unitTesting = [ "junit-fabric", "junit-params", "mockito-core", "mock-kotlin", "classgraph" ]
|
||||||
|
|
||||||
|
graal = [ "graal-core", "graal-sdk", "graal-regex", "graal-truffle", "icu4j" ]
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ dependencies {
|
|||||||
modLocalRuntime(libs.neoforge.debugutils)
|
modLocalRuntime(libs.neoforge.debugutils)
|
||||||
modRuntimeOnly(libs.bundles.neoforge.integrations.runtimeOnly)
|
modRuntimeOnly(libs.bundles.neoforge.integrations.runtimeOnly)
|
||||||
modRuntimeOnly(libs.bundles.mongo)
|
modRuntimeOnly(libs.bundles.mongo)
|
||||||
|
forgeRuntimeLibrary(libs.bundles.mongo)
|
||||||
|
|
||||||
implementation(libs.neo.kotlin.forge)
|
implementation(libs.neo.kotlin.forge)
|
||||||
|
|
||||||
@@ -52,22 +53,19 @@ dependencies {
|
|||||||
testImplementation(project(":common", configuration = "namedElements"))
|
testImplementation(project(":common", configuration = "namedElements"))
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
libs.graal,
|
libs.bundles.graal,
|
||||||
libs.bundles.mongo
|
libs.bundles.mongo
|
||||||
).forEach {
|
).forEach {
|
||||||
include(it)
|
include(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
libs.graal,
|
|
||||||
libs.molang
|
libs.molang
|
||||||
).forEach {
|
).forEach {
|
||||||
forgeRuntimeLibrary(it)
|
forgeRuntimeLibrary(it)
|
||||||
bundle(it)
|
bundle(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
forgeRuntimeLibrary(libs.bundles.mongo)
|
|
||||||
bundle(libs.bundles.mongo)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
Reference in New Issue
Block a user