diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt index dccd158c9..062564586 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt @@ -35,8 +35,7 @@ object DecimalCodec : Codec { ops.getIntStream(input).flatMap { try { DataResult.success(Pair(Decimal.fromByteArray( - it.mapToObj { val v = it.toLong(); Stream.of(v and 0xFFL, (v and 0xFF00L) ushr 8, (v and 0xFF0000L) ushr 16, (v and 0xFF000000L) ushr 24) } - .flatMap { it } + it .collect(::ByteArrayList, { v, a -> v.add(a.toByte()) }, ByteArrayList::addAll) .toByteArray() ), ops.empty()))