Skip to content

Commit

Permalink
PC-1070 Tempfix for server initialization issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Polyana committed Dec 21, 2023
1 parent d9c86d2 commit a50f10b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ val inlineLoggerVersion: String by rootProject

dependencies {
api(project(":api"))
compileOnly("com.michael-bull.kotlin-inline-logger:kotlin-inline-logger:$inlineLoggerVersion")
implementation("com.michael-bull.kotlin-inline-logger:kotlin-inline-logger:$inlineLoggerVersion")
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ class MineCitySqlPersistence(
}
}
}
if (result.success)
TODO()
}
}
3 changes: 2 additions & 1 deletion platform/fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricVersion")
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")
modImplementation(include("net.kyori:adventure-platform-fabric:5.9.0")!!)
//modImplementation(include("net.kyori:adventure-platform-fabric:5.9.0")!!)
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

// modImplementation("net.fabricmc.fabric-api:fabric-api-deprecated:${project.findProperty("fabric_version")}")
implementation(include(project(":api"))!!)
implementation(include(project(":core"))!!)
persistenceProject.subprojects.forEach { persistenceImpl ->
implementation(include(project(persistenceImpl.path))!!)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package br.com.gamemods.minecity.fabric

import br.com.gamemods.minecity.api.MineCity
import br.com.gamemods.minecity.api.MineCityPlatform
import br.com.gamemods.minecity.api.annotation.internal.InternalMineCityApi
import br.com.gamemods.minecity.api.annotation.side.ServerSideOnly
Expand All @@ -25,8 +24,6 @@ import com.github.michaelbull.logging.InlineLogger
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.asCoroutineDispatcher
import net.fabricmc.api.ModInitializer
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents
import net.minecraft.server.MinecraftServer
import net.minecraft.server.world.ServerWorld
import net.minecraft.world.chunk.WorldChunk
Expand Down Expand Up @@ -61,14 +58,15 @@ object MineCityFabric : ModInitializer, MineCityPlatform {
worlds = FabricWorldService(this),
players = FabricNamedPlayerService(this),
)
MineCity.instance = core
//FIXME
/*MineCity.instance = core
core.onInitialize()
ServerLifecycleEvents.SERVER_STARTING.register(this::handleServerStarting)
ServerLifecycleEvents.SERVER_STARTED.register(this::handleServerStarted)
ServerLifecycleEvents.SERVER_STOPPING.register(this::handleServerStopping)
ServerLifecycleEvents.SERVER_STOPPED.register(this::handleServerStopped)
ServerChunkEvents.CHUNK_LOAD.register(this::handleChunkLoad)
ServerChunkEvents.CHUNK_UNLOAD.register(this::handleChunkUnload)
ServerChunkEvents.CHUNK_UNLOAD.register(this::handleChunkUnload)*/
}

@ServerSideOnly
Expand Down
2 changes: 1 addition & 1 deletion platform/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"entrypoints": {
"main": [
{
"value": "br.com.gamemods.minecity.fabric.common.MineCityFabric",
"value": "br.com.gamemods.minecity.fabric.MineCityFabric",
"adapter": "kotlin"
}
],
Expand Down

0 comments on commit a50f10b

Please sign in to comment.