NibbleArrayReader .java

net.minecraft.world.chunk.storage.NibbleArrayReader (class, 24 lines): members: depthBitsPlusFour, depthBits, get, data.

net.minecraft.world.chunk.storageclass24 linescommon666 B

API Surface (1)

int get(int p_76686_1_, int p_76686_2_, int p_76686_3_)

Fields & Constants (3)

data
depthBits
depthBitsPlusFour

Full Source

NibbleArrayReader.java24 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.chunk.storage;
2
3
public class NibbleArrayReader
4
{
5
    public final byte[] data;
6
    private final int depthBits;
7
    private final int depthBitsPlusFour;
8
9
    public NibbleArrayReader(byte[] dataIn, int depthBitsIn)
10
    {
11
        this.data = dataIn;
12
        this.depthBits = depthBitsIn;
13
        this.depthBitsPlusFour = depthBitsIn + 4;
14
    }
15
16
    public int get(int p_76686_1_, int p_76686_2_, int p_76686_3_)
17
    {
18
        int i = p_76686_1_ << this.depthBitsPlusFour | p_76686_3_ << this.depthBits | p_76686_2_;
19
        int j = i >> 1;
20
        int k = i & 1;
21
        return k == 0 ? this.data[j] & 15 : this.data[j] >> 4 & 15;
22
    }
23
}
24

Deobfuscated MCP 1.8.9 source of NibbleArrayReader from Marcelektro/MavenMCP-1.8.9 (net/minecraft/world/chunk/storage/NibbleArrayReader.java), stored verbatim.