From 33e942f51774c9b1b70e8dc38c5d77013777273d Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Fri, 8 Jan 2021 14:37:06 +0100 Subject: [PATCH] Cleanup TODO comments --- uranos-api/src/main/kotlin/space/uranos/Uranos.kt | 4 +--- uranos-api/src/main/kotlin/space/uranos/command/Command.kt | 1 - uranos-api/src/main/kotlin/space/uranos/recipe/Recipe.kt | 1 - uranos-api/src/main/kotlin/space/uranos/tag/Tag.kt | 2 +- uranos-api/src/main/kotlin/space/uranos/world/ChunkData.kt | 2 -- uranos-server/build.gradle.kts | 2 +- uranos-server/src/main/kotlin/space/uranos/UranosServer.kt | 2 +- 7 files changed, 4 insertions(+), 10 deletions(-) diff --git a/uranos-api/src/main/kotlin/space/uranos/Uranos.kt b/uranos-api/src/main/kotlin/space/uranos/Uranos.kt index d61f9d1..53609eb 100644 --- a/uranos-api/src/main/kotlin/space/uranos/Uranos.kt +++ b/uranos-api/src/main/kotlin/space/uranos/Uranos.kt @@ -7,6 +7,4 @@ package space.uranos import space.uranos.server.Server -private lateinit var serverInstance: Server - -val Uranos get() = serverInstance +lateinit var Uranos: Server; private set diff --git a/uranos-api/src/main/kotlin/space/uranos/command/Command.kt b/uranos-api/src/main/kotlin/space/uranos/command/Command.kt index a833435..2798f44 100644 --- a/uranos-api/src/main/kotlin/space/uranos/command/Command.kt +++ b/uranos-api/src/main/kotlin/space/uranos/command/Command.kt @@ -9,5 +9,4 @@ import space.uranos.RegistryItem abstract class Command : RegistryItem { abstract override val id: String - // TODO } diff --git a/uranos-api/src/main/kotlin/space/uranos/recipe/Recipe.kt b/uranos-api/src/main/kotlin/space/uranos/recipe/Recipe.kt index e3f5416..eff8123 100644 --- a/uranos-api/src/main/kotlin/space/uranos/recipe/Recipe.kt +++ b/uranos-api/src/main/kotlin/space/uranos/recipe/Recipe.kt @@ -9,5 +9,4 @@ import space.uranos.RegistryItem sealed class Recipe: RegistryItem { abstract val group: String - // TODO } diff --git a/uranos-api/src/main/kotlin/space/uranos/tag/Tag.kt b/uranos-api/src/main/kotlin/space/uranos/tag/Tag.kt index e3e9e6d..2c95fb1 100644 --- a/uranos-api/src/main/kotlin/space/uranos/tag/Tag.kt +++ b/uranos-api/src/main/kotlin/space/uranos/tag/Tag.kt @@ -11,7 +11,7 @@ import space.uranos.world.NUMERIC_FLUID_IDS_BY_ID import space.uranos.world.block.Material // TODO: Allow plugins to create custom tags and actually use tag values server-side -class Tag(val name: String, val type: Type, val rawValues: List) { +class Tag(val name: String, val type: Type, private val rawValues: List) { val values: List by lazy { val tags = TagRegistry.tagsByNameByType.getValue(type) diff --git a/uranos-api/src/main/kotlin/space/uranos/world/ChunkData.kt b/uranos-api/src/main/kotlin/space/uranos/world/ChunkData.kt index aa4befb..bab1240 100644 --- a/uranos-api/src/main/kotlin/space/uranos/world/ChunkData.kt +++ b/uranos-api/src/main/kotlin/space/uranos/world/ChunkData.kt @@ -33,8 +33,6 @@ data class ChunkData( * Will be computed using [sections] if null. */ val nonAirBlocksHeightmap: ByteArray? = null - - // TODO: Add options for specifying how the encoded packet should be cached. ) { companion object { diff --git a/uranos-server/build.gradle.kts b/uranos-server/build.gradle.kts index 82c4460..5ab8311 100644 --- a/uranos-server/build.gradle.kts +++ b/uranos-server/build.gradle.kts @@ -16,7 +16,7 @@ repositories { dependencies { // Kotlin implementation(KotlinX.coroutines.core) - implementation(KotlinX.coroutines.jdk8) // TODO: What is jdk9? + implementation(KotlinX.coroutines.jdk8) // Uranos implementation(project(":uranos-api")) diff --git a/uranos-server/src/main/kotlin/space/uranos/UranosServer.kt b/uranos-server/src/main/kotlin/space/uranos/UranosServer.kt index 2c37f88..2c2d129 100644 --- a/uranos-server/src/main/kotlin/space/uranos/UranosServer.kt +++ b/uranos-server/src/main/kotlin/space/uranos/UranosServer.kt @@ -151,7 +151,7 @@ class UranosServer internal constructor() : Server() { fun setServerInstance(instance: Server) { val clazz = Class.forName("space.uranos.UranosKt") - val field = clazz.getDeclaredField("serverInstance") + val field = clazz.getDeclaredField("Uranos") field.isAccessible = true field.set(null, instance) field.isAccessible = false