diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt index 2fa1768b..0a749737 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt @@ -78,8 +78,8 @@ fun main() { reader.skipBytes(1) // Foreground hue shift reader.skipBytes(1) // Foreground color variant - val modifier = reader.readShort() - val getModifier = Starbound.tileModifiersByIDAccess[modifier.toInt()] + val modifier = reader.readUnsignedShort() + val getModifier = Starbound.tileModifiersByIDAccess[modifier] if (getModifier != null && getMat != null) { chunk.foreground[x, y]?.modifier = getModifier @@ -98,8 +98,8 @@ fun main() { reader.skipBytes(1) // Background hue shift reader.skipBytes(1) // Background color variant - val modifier2 = reader.readShort() - val getModifier2 = Starbound.tileModifiersByIDAccess[modifier2.toInt()] + val modifier2 = reader.readUnsignedShort() + val getModifier2 = Starbound.tileModifiersByIDAccess[modifier2] if (getModifier2 != null && getMat2 != null) { chunk.background[x, y]?.modifier = getModifier2 diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientChunk.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientChunk.kt index 77db4c69..b5792416 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientChunk.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientChunk.kt @@ -252,7 +252,7 @@ class ClientChunk(world: ClientWorld, pos: ChunkPos) : Chunk zNew). * - * Если следующего слоя нет, вернуть -1, и данный объект + * Если следующего слоя нет, вернуть [Int.MIN_VALUE], и данный объект * будет считаться отрисованным. */ fun renderLayerFromStack(zPos: Int, stack: Matrix4fStack): Int @@ -27,7 +27,7 @@ interface ILayeredRenderer { /** * Возвращает наибольшее zPos в данной стопке. * - * Если стопка пуста, то необходимо вернуть -1. + * Если стопка пуста, то необходимо вернуть [Int.MIN_VALUE]. * * В зависимости от сцены, которую необходимо отрисовать, * [renderLayerFromStack] может быть вызван сразу с этим же значением, @@ -62,7 +62,7 @@ fun renderLayeredList(transform: Matrix4fStack, potentialRenderers: List