From 4fc33b2cb62cbc1a4ea7a3974552f16d9955be0f Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 18 Apr 2024 18:41:29 +0700 Subject: [PATCH] Fix TileModification having wrong code for reading hue shift from network --- .../ru/dbotthepony/kstarbound/world/TileModification.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/world/TileModification.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/world/TileModification.kt index e20b9570..1c324500 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/world/TileModification.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/world/TileModification.kt @@ -56,7 +56,7 @@ sealed class TileModification { abstract fun apply(world: World<*, *>, position: Vector2i, allowEntityOverlap: Boolean) data class PlaceMaterial(val isBackground: Boolean, val material: Registry.Ref, val hueShift: Float?) : TileModification() { - constructor(stream: DataInputStream, isLegacy: Boolean) : this(stream.readBoolean(), if (isLegacy) Registries.tiles.ref(stream.readUnsignedShort()) else TODO(), if (isLegacy) stream.readNullable { stream.readUnsignedByte() / 255f } else stream.readNullableFloat()) + constructor(stream: DataInputStream, isLegacy: Boolean) : this(stream.readBoolean(), if (isLegacy) Registries.tiles.ref(stream.readUnsignedShort()) else TODO(), if (isLegacy) stream.readNullable { stream.readUnsignedByte() / 255f * 360f } else stream.readNullableFloat()) override fun write(stream: DataOutputStream, isLegacy: Boolean) { stream.writeByte(1) @@ -154,7 +154,7 @@ sealed class TileModification { } data class PlaceModifier(val isBackground: Boolean, val modifier: Registry.Ref, val hueShift: Float?) : TileModification() { - constructor(stream: DataInputStream, isLegacy: Boolean) : this(stream.readBoolean(), if (isLegacy) Registries.tileModifiers.ref(stream.readUnsignedShort()) else TODO(), if (isLegacy) stream.readNullable { stream.readUnsignedByte() / 255f } else stream.readNullableFloat()) + constructor(stream: DataInputStream, isLegacy: Boolean) : this(stream.readBoolean(), if (isLegacy) Registries.tileModifiers.ref(stream.readUnsignedShort()) else TODO(), if (isLegacy) stream.readNullable { stream.readUnsignedByte() / 255f * 360f } else stream.readNullableFloat()) override fun write(stream: DataOutputStream, isLegacy: Boolean) { stream.writeByte(2)