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/ChunkNibbleArray- intermediary - net/minecraft/class_2804- official - dyy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected @org.jetbrains.annotations.Nullable byte[]static final intstatic final intstatic final intprivate intprivate static final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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_TIMESpublic static final int COPY_TIMES- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - COPY_TIMES- Lnet/minecraft/world/chunk/ChunkNibbleArray;COPY_TIMES:I- intermediary - field_34052- Lnet/minecraft/class_2804;field_34052:I- official - a- Ldyy;a:I
 
- 
COPY_BLOCK_SIZEpublic static final int COPY_BLOCK_SIZE- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - COPY_BLOCK_SIZE- Lnet/minecraft/world/chunk/ChunkNibbleArray;COPY_BLOCK_SIZE:I- intermediary - field_31404- Lnet/minecraft/class_2804;field_31404:I- official - b- Ldyy;b:I
 
- 
BYTES_LENGTHpublic static final int BYTES_LENGTH- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - BYTES_LENGTH- Lnet/minecraft/world/chunk/ChunkNibbleArray;BYTES_LENGTH:I- intermediary - field_31403- Lnet/minecraft/class_2804;field_31403:I- official - c- Ldyy;c:I
 
- 
NIBBLE_BITSprivate static final int NIBBLE_BITS- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - NIBBLE_BITS- Lnet/minecraft/world/chunk/ChunkNibbleArray;NIBBLE_BITS:I- intermediary - field_31405- Lnet/minecraft/class_2804;field_31405:I- official - e- Ldyy;e:I
 
- 
bytes- Mappings:
- Namespace - Name - Mixin selector - named - bytes- Lnet/minecraft/world/chunk/ChunkNibbleArray;bytes:[B- intermediary - field_12783- Lnet/minecraft/class_2804;field_12783:[B- official - d- Ldyy;d:[B
 
- 
defaultValueprivate int defaultValue- Mappings:
- Namespace - Name - Mixin selector - named - defaultValue- Lnet/minecraft/world/chunk/ChunkNibbleArray;defaultValue:I- intermediary - field_44635- Lnet/minecraft/class_2804;field_44635:I- official - f- Ldyy;f:I
 
 
- 
- 
Constructor Details- 
ChunkNibbleArraypublic ChunkNibbleArray()
- 
ChunkNibbleArraypublic ChunkNibbleArray(int defaultValue) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/world/chunk/ChunkNibbleArray;<init>(I)V- intermediary - <init>- Lnet/minecraft/class_2804;<init>(I)V- official - <init>- Ldyy;<init>(I)V
 
- 
ChunkNibbleArraypublic ChunkNibbleArray(byte[] bytes) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/world/chunk/ChunkNibbleArray;<init>([B)V- intermediary - <init>- Lnet/minecraft/class_2804;<init>([B)V- official - <init>- Ldyy;<init>([B)V
 
 
- 
- 
Method Details- 
getpublic 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 - get- Lnet/minecraft/world/chunk/ChunkNibbleArray;get(III)I- intermediary - method_12139- Lnet/minecraft/class_2804;method_12139(III)I- official - a- Ldyy;a(III)I
 
- 
setpublic 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 - set- Lnet/minecraft/world/chunk/ChunkNibbleArray;set(IIII)V- intermediary - method_12145- Lnet/minecraft/class_2804;method_12145(IIII)V- official - a- Ldyy;a(IIII)V
 
- 
getIndexprivate static int getIndex(int x, int y, int z) - Mappings:
- Namespace - Name - Mixin selector - named - getIndex- Lnet/minecraft/world/chunk/ChunkNibbleArray;getIndex(III)I- intermediary - method_12140- Lnet/minecraft/class_2804;method_12140(III)I- official - b- Ldyy;b(III)I
 
- 
getprivate int get(int index) - Mappings:
- Namespace - Name - Mixin selector - named - get- Lnet/minecraft/world/chunk/ChunkNibbleArray;get(I)I- intermediary - method_12141- Lnet/minecraft/class_2804;method_12141(I)I- official - d- Ldyy;d(I)I
 
- 
setprivate void set(int index, int value) - Mappings:
- Namespace - Name - Mixin selector - named - set- Lnet/minecraft/world/chunk/ChunkNibbleArray;set(II)V- intermediary - method_12142- Lnet/minecraft/class_2804;method_12142(II)V- official - a- Ldyy;a(II)V
 
- 
occupiesSmallerBitsprivate 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 - occupiesSmallerBits- Lnet/minecraft/world/chunk/ChunkNibbleArray;occupiesSmallerBits(I)I- intermediary - method_37459- Lnet/minecraft/class_2804;method_37459(I)I- official - e- Ldyy;e(I)I
 
- 
getArrayIndexprivate static int getArrayIndex(int i) - Mappings:
- Namespace - Name - Mixin selector - named - getArrayIndex- Lnet/minecraft/world/chunk/ChunkNibbleArray;getArrayIndex(I)I- intermediary - method_12138- Lnet/minecraft/class_2804;method_12138(I)I- official - f- Ldyy;f(I)I
 
- 
clearpublic void clear(int defaultValue) - Mappings:
- Namespace - Name - Mixin selector - named - clear- Lnet/minecraft/world/chunk/ChunkNibbleArray;clear(I)V- intermediary - method_51527- Lnet/minecraft/class_2804;method_51527(I)V- official - a- Ldyy;a(I)V
 
- 
packprivate static byte pack(int value) - Mappings:
- Namespace - Name - Mixin selector - named - pack- Lnet/minecraft/world/chunk/ChunkNibbleArray;pack(I)B- intermediary - method_51381- Lnet/minecraft/class_2804;method_51381(I)B- official - g- Ldyy;g(I)B
 
- 
asByteArraypublic byte[] asByteArray()- Mappings:
- Namespace - Name - Mixin selector - named - asByteArray- Lnet/minecraft/world/chunk/ChunkNibbleArray;asByteArray()[B- intermediary - method_12137- Lnet/minecraft/class_2804;method_12137()[B- official - a- Ldyy;a()[B
 
- 
copy- Mappings:
- Namespace - Name - Mixin selector - named - copy- Lnet/minecraft/world/chunk/ChunkNibbleArray;copy()Lnet/minecraft/world/chunk/ChunkNibbleArray;- intermediary - method_12144- Lnet/minecraft/class_2804;method_12144()Lnet/minecraft/class_2804;- official - b- Ldyy;b()Ldyy;
 
- 
toString
- 
bottomToStringReturns 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 - bottomToString- Lnet/minecraft/world/chunk/ChunkNibbleArray;bottomToString(I)Ljava/lang/String;- intermediary - method_35320- Lnet/minecraft/class_2804;method_35320(I)Ljava/lang/String;- official - b- Ldyy;b(I)Ljava/lang/String;
 
- 
isArrayUninitializedpublic boolean isArrayUninitialized()- Mappings:
- Namespace - Name - Mixin selector - named - isArrayUninitialized- Lnet/minecraft/world/chunk/ChunkNibbleArray;isArrayUninitialized()Z- intermediary - method_51380- Lnet/minecraft/class_2804;method_51380()Z- official - c- Ldyy;c()Z
 
- 
isUninitializedpublic boolean isUninitialized(int expectedDefaultValue) - Mappings:
- Namespace - Name - Mixin selector - named - isUninitialized- Lnet/minecraft/world/chunk/ChunkNibbleArray;isUninitialized(I)Z- intermediary - method_51379- Lnet/minecraft/class_2804;method_51379(I)Z- official - c- Ldyy;c(I)Z
 
- 
isUninitializedpublic boolean isUninitialized()- Mappings:
- Namespace - Name - Mixin selector - named - isUninitialized- Lnet/minecraft/world/chunk/ChunkNibbleArray;isUninitialized()Z- intermediary - method_12146- Lnet/minecraft/class_2804;method_12146()Z- official - d- Ldyy;d()Z
 
 
-