Package net.minecraft.world.chunk
Class ChunkNibbleArray
java.lang.Object
net.minecraft.world.chunk.ChunkNibbleArray
A chunk nibble array is an array of nibbles for each block position in
a chunk. It is most often used to store light data.
A nibble is 4 bits, storing an integer from 0 to
15. It takes half the space of a byte.
The nibbles are stored in an X-Z-Y major order; in the backing array, the indices increases by first increasing X, then Z, and finally Y.
- Mappings:
Namespace Name named net/minecraft/world/chunk/ChunkNibbleArrayintermediary net/minecraft/class_2804official dvd
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @org.jetbrains.annotations.Nullable byte[]static final intstatic final intstatic final intprivate intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bottomToString(int unused) Returns a hexadecimal string representation of they=0level of this array.voidclear(int defaultValue) copy()private intget(int index) intget(int x, int y, int z) Returns the integer value of a nibble, in[0, 15].private static intgetArrayIndex(int i) private static intgetIndex(int x, int y, int z) booleanbooleanbooleanisUninitialized(int expectedDefaultValue) private static intoccupiesSmallerBits(int i) Returns if the nibble atnis stored in the less significant (smaller) 4 bits of the byte in the backing array.private static bytepack(int value) private voidset(int index, int value) voidset(int x, int y, int z, int value) Sets the value of a nibble.toString()
-
Field Details
-
COPY_TIMES
public static final int COPY_TIMES- See Also:
- Mappings:
Namespace Name Mixin selector named COPY_TIMESLnet/minecraft/world/chunk/ChunkNibbleArray;COPY_TIMES:Iintermediary field_34052Lnet/minecraft/class_2804;field_34052:Iofficial aLdvd;a:I
-
COPY_BLOCK_SIZE
public static final int COPY_BLOCK_SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named COPY_BLOCK_SIZELnet/minecraft/world/chunk/ChunkNibbleArray;COPY_BLOCK_SIZE:Iintermediary field_31404Lnet/minecraft/class_2804;field_31404:Iofficial bLdvd;b:I
-
BYTES_LENGTH
public static final int BYTES_LENGTH- See Also:
- Mappings:
Namespace Name Mixin selector named BYTES_LENGTHLnet/minecraft/world/chunk/ChunkNibbleArray;BYTES_LENGTH:Iintermediary field_31403Lnet/minecraft/class_2804;field_31403:Iofficial cLdvd;c:I
-
NIBBLE_BITS
private static final int NIBBLE_BITS- See Also:
- Mappings:
Namespace Name Mixin selector named NIBBLE_BITSLnet/minecraft/world/chunk/ChunkNibbleArray;NIBBLE_BITS:Iintermediary field_31405Lnet/minecraft/class_2804;field_31405:Iofficial eLdvd;e:I
-
bytes
- Mappings:
Namespace Name Mixin selector named bytesLnet/minecraft/world/chunk/ChunkNibbleArray;bytes:[Bintermediary field_12783Lnet/minecraft/class_2804;field_12783:[Bofficial dLdvd;d:[B
-
defaultValue
private int defaultValue- Mappings:
Namespace Name Mixin selector named defaultValueLnet/minecraft/world/chunk/ChunkNibbleArray;defaultValue:Iintermediary field_44635Lnet/minecraft/class_2804;field_44635:Iofficial fLdvd;f:I
-
-
Constructor Details
-
ChunkNibbleArray
public ChunkNibbleArray() -
ChunkNibbleArray
public ChunkNibbleArray(int defaultValue) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/ChunkNibbleArray;<init>(I)Vintermediary <init>Lnet/minecraft/class_2804;<init>(I)Vofficial <init>Ldvd;<init>(I)V
-
ChunkNibbleArray
public ChunkNibbleArray(byte[] bytes) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/ChunkNibbleArray;<init>([B)Vintermediary <init>Lnet/minecraft/class_2804;<init>([B)Vofficial <init>Ldvd;<init>([B)V
-
-
Method Details
-
get
public int get(int x, int y, int z) Returns the integer value of a nibble, in[0, 15].- Returns:
- the integer value of a nibble, in
[0, 15] - Mappings:
Namespace Name Mixin selector named getLnet/minecraft/world/chunk/ChunkNibbleArray;get(III)Iintermediary method_12139Lnet/minecraft/class_2804;method_12139(III)Iofficial aLdvd;a(III)I
-
set
public void set(int x, int y, int z, int value) Sets the value of a nibble.If the
valuehas bits outside of the lowest 4 set to1, (value is outside of[0, 15]), the extraneous bits are discarded.- Mappings:
Namespace Name Mixin selector named setLnet/minecraft/world/chunk/ChunkNibbleArray;set(IIII)Vintermediary method_12145Lnet/minecraft/class_2804;method_12145(IIII)Vofficial aLdvd;a(IIII)V
-
getIndex
private static int getIndex(int x, int y, int z) - Mappings:
Namespace Name Mixin selector named getIndexLnet/minecraft/world/chunk/ChunkNibbleArray;getIndex(III)Iintermediary method_12140Lnet/minecraft/class_2804;method_12140(III)Iofficial bLdvd;b(III)I
-
get
private int get(int index) - Mappings:
Namespace Name Mixin selector named getLnet/minecraft/world/chunk/ChunkNibbleArray;get(I)Iintermediary method_12141Lnet/minecraft/class_2804;method_12141(I)Iofficial dLdvd;d(I)I
-
set
private void set(int index, int value) - Mappings:
Namespace Name Mixin selector named setLnet/minecraft/world/chunk/ChunkNibbleArray;set(II)Vintermediary method_12142Lnet/minecraft/class_2804;method_12142(II)Vofficial aLdvd;a(II)V
-
occupiesSmallerBits
private static int occupiesSmallerBits(int i) Returns if the nibble atnis stored in the less significant (smaller) 4 bits of the byte in the backing array.- Returns:
- if the nibble at
nis stored in the less significant (smaller) 4 bits of the byte in the backing array - Mappings:
Namespace Name Mixin selector named occupiesSmallerBitsLnet/minecraft/world/chunk/ChunkNibbleArray;occupiesSmallerBits(I)Iintermediary method_37459Lnet/minecraft/class_2804;method_37459(I)Iofficial eLdvd;e(I)I
-
getArrayIndex
private static int getArrayIndex(int i) - Mappings:
Namespace Name Mixin selector named getArrayIndexLnet/minecraft/world/chunk/ChunkNibbleArray;getArrayIndex(I)Iintermediary method_12138Lnet/minecraft/class_2804;method_12138(I)Iofficial fLdvd;f(I)I
-
clear
public void clear(int defaultValue) - Mappings:
Namespace Name Mixin selector named clearLnet/minecraft/world/chunk/ChunkNibbleArray;clear(I)Vintermediary method_51527Lnet/minecraft/class_2804;method_51527(I)Vofficial aLdvd;a(I)V
-
pack
private static byte pack(int value) - Mappings:
Namespace Name Mixin selector named packLnet/minecraft/world/chunk/ChunkNibbleArray;pack(I)Bintermediary method_51381Lnet/minecraft/class_2804;method_51381(I)Bofficial gLdvd;g(I)B
-
asByteArray
public byte[] asByteArray()- Mappings:
Namespace Name Mixin selector named asByteArrayLnet/minecraft/world/chunk/ChunkNibbleArray;asByteArray()[Bintermediary method_12137Lnet/minecraft/class_2804;method_12137()[Bofficial aLdvd;a()[B
-
copy
- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/world/chunk/ChunkNibbleArray;copy()Lnet/minecraft/world/chunk/ChunkNibbleArray;intermediary method_12144Lnet/minecraft/class_2804;method_12144()Lnet/minecraft/class_2804;official bLdvd;b()Ldvd;
-
toString
-
bottomToString
Returns a hexadecimal string representation of they=0level of this array.It is useful for debugging the grid nibble array.
- Parameters:
unused- unused- Returns:
- a hexadecimal string representation of the
y=0level of this array - Mappings:
Namespace Name Mixin selector named bottomToStringLnet/minecraft/world/chunk/ChunkNibbleArray;bottomToString(I)Ljava/lang/String;intermediary method_35320Lnet/minecraft/class_2804;method_35320(I)Ljava/lang/String;official bLdvd;b(I)Ljava/lang/String;
-
isArrayUninitialized
public boolean isArrayUninitialized()- Mappings:
Namespace Name Mixin selector named isArrayUninitializedLnet/minecraft/world/chunk/ChunkNibbleArray;isArrayUninitialized()Zintermediary method_51380Lnet/minecraft/class_2804;method_51380()Zofficial cLdvd;c()Z
-
isUninitialized
public boolean isUninitialized(int expectedDefaultValue) - Mappings:
Namespace Name Mixin selector named isUninitializedLnet/minecraft/world/chunk/ChunkNibbleArray;isUninitialized(I)Zintermediary method_51379Lnet/minecraft/class_2804;method_51379(I)Zofficial cLdvd;c(I)Z
-
isUninitialized
public boolean isUninitialized()- Mappings:
Namespace Name Mixin selector named isUninitializedLnet/minecraft/world/chunk/ChunkNibbleArray;isUninitialized()Zintermediary method_12146Lnet/minecraft/class_2804;method_12146()Zofficial dLdvd;d()Z
-