Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
alias(libs.plugins.gradle.neoforgegradle) apply false
alias(libs.plugins.klibs.gradle.detekt) apply false
alias(libs.plugins.klibs.gradle.dokka.root)
// alias(libs.plugins.klibs.gradle.dokka.root)
alias(libs.plugins.klibs.gradle.java.version) apply false
alias(libs.plugins.klibs.gradle.publication) apply false
alias(libs.plugins.klibs.gradle.rootinfo) apply false
Expand Down
2 changes: 2 additions & 0 deletions core-forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dependencies {
implementation(projects.command)
implementation(projects.core)

api(projects.coreMinecraft)

testImplementation(libs.kotlin.serialization.kaml)
testImplementation(libs.tests.kotlin.test)
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import net.minecraftforge.event.server.ServerStartedEvent
import net.minecraftforge.event.server.ServerStoppingEvent
import net.minecraftforge.eventbus.api.EventPriority
import ru.astrainteractive.astralibs.event.flowEvent
import ru.astrainteractive.astralibs.server.util.ForgeUtil
import ru.astrainteractive.astralibs.server.util.MinecraftUtil
import ru.astrainteractive.klibs.mikro.core.logging.Logger

abstract class ForgeLifecycleServer : Lifecycle, Logger {
private val unconfinedScope = CoroutineScope(SupervisorJob() + Dispatchers.Unconfined)

val serverStartedEvent = flowEvent<ServerStartedEvent>(EventPriority.HIGHEST)
.onEach { event -> MinecraftUtil.setServer(event.server) }
.onEach { onEnable() }
.catch { throwable ->
error(throwable) { "#serverStartedEvent ${throwable.localizedMessage}" }
Expand All @@ -31,8 +32,4 @@ abstract class ForgeLifecycleServer : Lifecycle, Logger {
error(throwable) { "#serverStartedEvent ${throwable.localizedMessage}" }
}
.launchIn(unconfinedScope)

init {
ForgeUtil.bootstrap()
}
}
Loading
Loading