Skip to content

Commit

Permalink
Fix minestom version
Browse files Browse the repository at this point in the history
  • Loading branch information
mani1232 committed Jul 15, 2024
1 parent c46416b commit b18ed91
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ class FabricExceptionTest {

// Assert
Assertions.assertNotEquals(ioThreadId, actualThreadId)
//Assertions.assertEquals(2, logMessageCounter)
Assertions.assertEquals(1, logMessageCounter) // old value is 2
}
}
4 changes: 2 additions & 2 deletions mccoroutine-minestom-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tasks.withType<KotlinCompile>().configureEach {

dependencies {
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC")
compileOnly("net.minestom:minestom-snapshots:7320437640")
compileOnly("net.minestom:minestom-snapshots:6fc64e3a5d")
implementation("dev.hollowcube:minestom-ce-extensions:1.2.0")
testImplementation("net.minestom:minestom-snapshots:7320437640")
testImplementation("net.minestom:minestom-snapshots:6fc64e3a5d")
}
4 changes: 2 additions & 2 deletions mccoroutine-minestom-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies {

compileOnly("net.kyori:adventure-text-logger-slf4j:4.12.0")
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC")
implementation("net.minestom:minestom-snapshots:7320437640")
implementation("net.minestom:minestom-snapshots:6fc64e3a5d")
implementation("dev.hollowcube:minestom-ce-extensions:1.2.0")
testImplementation("net.minestom:minestom-snapshots:7320437640")
testImplementation("net.minestom:minestom-snapshots:6fc64e3a5d")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC")
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ internal open class AsyncCoroutineDispatcher() : CoroutineDispatcher() {
* Handles dispatching the coroutine on the correct thread.
*/
override fun dispatch(context: CoroutineContext, block: Runnable) {
MinecraftServer.getSchedulerManager().scheduleNextTick(block, ExecutionType.ASYNC)
MinecraftServer.getSchedulerManager().scheduleNextTick(block, ExecutionType.TICK_START)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal open class MinecraftCoroutineDispatcher : CoroutineDispatcher() {

init {
MinecraftServer.getSchedulerManager().scheduleNextProcess {
mainThreadId = Thread.currentThread().id
mainThreadId = Thread.currentThread().threadId()
}
}

Expand All @@ -24,13 +24,13 @@ internal open class MinecraftCoroutineDispatcher : CoroutineDispatcher() {
* may leave the coroutines that use this dispatcher in the inconsistent and hard to debug state.
*/
override fun isDispatchNeeded(context: CoroutineContext): Boolean {
return Thread.currentThread().id != mainThreadId
return Thread.currentThread().threadId() != mainThreadId
}

/**
* Handles dispatching the coroutine on the correct thread.
*/
override fun dispatch(context: CoroutineContext, block: Runnable) {
MinecraftServer.getSchedulerManager().scheduleNextTick(block, ExecutionType.SYNC)
MinecraftServer.getSchedulerManager().scheduleNextTick(block, ExecutionType.TICK_START)
}
}
2 changes: 1 addition & 1 deletion mccoroutine-minestom-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.9.0-RC")

implementation("dev.hollowcube:minestom-ce-extensions:1.2.0")
implementation("net.minestom:minestom-snapshots:7320437640")
implementation("net.minestom:minestom-snapshots:6fc64e3a5d")
}

tasks.withType<Jar> {
Expand Down

0 comments on commit b18ed91

Please sign in to comment.