Skip to content

Commit

Permalink
Change to use ClientModInitializer so we only use 1 entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
VixidDev committed Jun 28, 2024
1 parent 8631f8f commit d8eaefb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 3 additions & 6 deletions src/main/kotlin/dev/vixid/vsm/VSM.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import net.fabricmc.api.ClientModInitializer
import org.slf4j.Logger
import org.slf4j.LoggerFactory

object VSM {
object VSM : ClientModInitializer {
val logger: Logger = LoggerFactory.getLogger("vsm")

val config = ManagedConfig.create(File("config/vsm/config.json"), VSMConfig::class.java) {
Expand All @@ -33,11 +34,7 @@ object VSM {
private val globalJob = Job()
val coroutineScope = CoroutineScope(CoroutineName("VSM") + SupervisorJob(globalJob))

@JvmStatic
fun onInitialise() {}

@JvmStatic
fun onInitialiseClient() {
override fun onInitializeClient() {
GlobalScreen.registerNativeHook()

config.instance.initialise()
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"icon": "assets/vsm/icon.png",
"environment": "client",
"entrypoints": {
"main": [
"dev.vixid.vsm.VSM::onInitialise"
],
"client": [
"dev.vixid.vsm.VSM::onInitialiseClient"
{
"value": "dev.vixid.vsm.VSM",
"adapter": "kotlin"
}
]
},
"mixins": [
Expand Down

0 comments on commit d8eaefb

Please sign in to comment.