https://kotlinlang.org logo
#announcements
Title
# announcements
e

ensirius

07/08/2017, 6:42 AM

http://i.imgur.com/iwA6PZH.png

k

karelpeeters

07/08/2017, 7:05 AM
blockData[] is int[]
, right?
You can also try just pasting the Java code in Idea and it will automatically convert it to Kotlin.
e

ensirius

07/08/2017, 7:13 AM
blockData :
Array<ByteArray>
k

karelpeeters

07/08/2017, 7:13 AM
And
x
is?
e

ensirius

07/08/2017, 7:14 AM
x:
Int
I already tryed converter..not helped
I fixed blockData type. Forgot that it's 2D array
k

karelpeeters

07/08/2017, 7:16 AM
wait
blockData
is an array of arrays? Of course you can't right-shift an array.
shr
shifts the bits of an
Int
, not elements of an array
e

ensirius

07/08/2017, 7:17 AM
val b: Byte = blockData[y shr 4][off]
it's fine
k

karelpeeters

07/08/2017, 7:17 AM
Ah right didn't notice that, my bad.
e

ensirius

07/08/2017, 7:18 AM
i fixed it! you gave me idea
val b: Int = blockData[y shr 4][off].toInt()
ty!
k

karelpeeters

07/08/2017, 7:18 AM
Did you try casting everything to the left of shr to int?
Ah what was the problem?
Okay, glad you managed to fix it!
1
❤️ 1