1.15.2 Chunk NBT: get block from position

Discussion in 'Spigot Plugin Development' started by FrankHeijden, Feb 1, 2020.

  1. Hi,

    I am trying to get a block from an xyz coordinate from a .mca chunk file. I ran in the following issue when looking at the pseudocode on Minecraft Wiki:

    Screenshot 2020-02-01 at 16.17.43.png

    On line 3, it states "change_array_element_size". What does this refer to in a Java coding environment?

  2. So I assume that you want to change the size of the elements of BlockStates so that the indices work. I suppose this is a read-only problem; in other words: given a certain n-bit long word, how many bits do you have from this and succeeding words to get the Palette-index?
    For example, given that the palette has a length of 16; the index would be ld(16) = 4. So in one long word (64 bits), you would have 64 / 4 = 16 possible indices. Every index is then exactly 4 bit long. Sorry if that is a little confusing...