aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt
deleted file mode 100644
index 366b81a..0000000
--- a/src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package moe.nea.notenoughupdates.util
-
-import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.Runnable
-import kotlin.coroutines.CoroutineContext
-import net.minecraft.client.MinecraftClient
-
-object MinecraftDispatcher : CoroutineDispatcher() {
- @ExperimentalCoroutinesApi
- override fun limitedParallelism(parallelism: Int): CoroutineDispatcher {
- throw UnsupportedOperationException("limitedParallelism is not supported for MinecraftDispatcher")
- }
-
- override fun isDispatchNeeded(context: CoroutineContext): Boolean =
- !MinecraftClient.getInstance().isOnThread
-
-
- override fun dispatch(context: CoroutineContext, block: Runnable) {
- MinecraftClient.getInstance().execute(block)
- }
-}