Package net.minecraft.util.collection
Class PackedIntegerArray
java.lang.Object
net.minecraft.util.collection.PackedIntegerArray
- All Implemented Interfaces:
PaletteStorage
- Mappings:
Namespace Name intermediary net/minecraft/class_3508official aplnamed net/minecraft/util/collection/PackedIntegerArray
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long[]private final intprivate final intprivate static final int[]Magic constants for faster integer division by a constant.private final intprivate final intprivate final intprivate final longprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionPackedIntegerArray(int elementBits, int size) PackedIntegerArray(int elementBits, int size, @org.jetbrains.annotations.Nullable long[] data) PackedIntegerArray(int elementBits, int size, int[] data) -
Method Summary
Modifier and TypeMethodDescriptioncopy()voidforEach(IntConsumer action) Executes anactionon all values in this storage, sequentially.intget(int index) Returns the value atindexin this storage.long[]getData()Returns the backing data of this storage.intReturns the number of bits each element in this storage uses.intgetSize()Returns the size of, or the number of elements in, this storage.private intgetStorageIndex(int index) voidset(int index, int value) Setsvaluetoindexin this storage.intswap(int index, int value) Setsvaluetoindexand returns the previous value in this storage.voidwritePaletteIndices(int[] out)
-
Field Details
-
INDEX_PARAMETERS
private static final int[] INDEX_PARAMETERSMagic constants for faster integer division by a constant.This is computed as
(n * scale + offset) >> (32 + shift). For a divisor n, the constants are stored as such:- scale at 3 * (n - 1)
- offset at 3 * (n - 1) + 1
- shift at 3 * (n - 1) + 2
- Mappings:
Namespace Name Mixin selector intermediary field_24078Lnet/minecraft/class_3508;field_24078:[Iofficial aLapl;a:[Inamed INDEX_PARAMETERSLnet/minecraft/util/collection/PackedIntegerArray;INDEX_PARAMETERS:[I
-
data
private final long[] data- Mappings:
Namespace Name Mixin selector intermediary field_15631Lnet/minecraft/class_3508;field_15631:[Jofficial bLapl;b:[Jnamed dataLnet/minecraft/util/collection/PackedIntegerArray;data:[J
-
elementBits
private final int elementBits- Mappings:
Namespace Name Mixin selector intermediary field_15633Lnet/minecraft/class_3508;field_15633:Iofficial cLapl;c:Inamed elementBitsLnet/minecraft/util/collection/PackedIntegerArray;elementBits:I
-
maxValue
private final long maxValue- Mappings:
Namespace Name Mixin selector intermediary field_15634Lnet/minecraft/class_3508;field_15634:Jofficial dLapl;d:Jnamed maxValueLnet/minecraft/util/collection/PackedIntegerArray;maxValue:J
-
size
private final int size- Mappings:
Namespace Name Mixin selector intermediary field_15632Lnet/minecraft/class_3508;field_15632:Iofficial eLapl;e:Inamed sizeLnet/minecraft/util/collection/PackedIntegerArray;size:I
-
elementsPerLong
private final int elementsPerLong- Mappings:
Namespace Name Mixin selector intermediary field_24079Lnet/minecraft/class_3508;field_24079:Iofficial fLapl;f:Inamed elementsPerLongLnet/minecraft/util/collection/PackedIntegerArray;elementsPerLong:I
-
indexScale
private final int indexScale- Mappings:
Namespace Name Mixin selector intermediary field_24080Lnet/minecraft/class_3508;field_24080:Iofficial gLapl;g:Inamed indexScaleLnet/minecraft/util/collection/PackedIntegerArray;indexScale:I
-
indexOffset
private final int indexOffset- Mappings:
Namespace Name Mixin selector intermediary field_24081Lnet/minecraft/class_3508;field_24081:Iofficial hLapl;h:Inamed indexOffsetLnet/minecraft/util/collection/PackedIntegerArray;indexOffset:I
-
indexShift
private final int indexShift- Mappings:
Namespace Name Mixin selector intermediary field_24082Lnet/minecraft/class_3508;field_24082:Iofficial iLapl;i:Inamed indexShiftLnet/minecraft/util/collection/PackedIntegerArray;indexShift:I
-
-
Constructor Details
-
PackedIntegerArray
public PackedIntegerArray(int elementBits, int size, int[] data) - Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_3508;<init>(II[I)Vofficial <init>Lapl;<init>(II[I)Vnamed <init>Lnet/minecraft/util/collection/PackedIntegerArray;<init>(II[I)V
-
PackedIntegerArray
public PackedIntegerArray(int elementBits, int size) - Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_3508;<init>(II)Vofficial <init>Lapl;<init>(II)Vnamed <init>Lnet/minecraft/util/collection/PackedIntegerArray;<init>(II)V
-
PackedIntegerArray
public PackedIntegerArray(int elementBits, int size, @Nullable @org.jetbrains.annotations.Nullable long[] data) - Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_3508;<init>(II[J)Vofficial <init>Lapl;<init>(II[J)Vnamed <init>Lnet/minecraft/util/collection/PackedIntegerArray;<init>(II[J)V
-
-
Method Details
-
getStorageIndex
private int getStorageIndex(int index) - Mappings:
Namespace Name Mixin selector intermediary method_27284Lnet/minecraft/class_3508;method_27284(I)Iofficial bLapl;b(I)Inamed getStorageIndexLnet/minecraft/util/collection/PackedIntegerArray;getStorageIndex(I)I
-
swap
public int swap(int index, int value) Setsvaluetoindexand returns the previous value in this storage.- Specified by:
swapin interfacePaletteStorage- Parameters:
index- the indexvalue- the value to set- Returns:
- the previous value
- Mappings:
Namespace Name Mixin selector intermediary method_15214Lnet/minecraft/class_6490;method_15214(II)Iofficial aLans;a(II)Inamed swapLnet/minecraft/util/collection/PaletteStorage;swap(II)I
-
set
public void set(int index, int value) Setsvaluetoindexin this storage.- Specified by:
setin interfacePaletteStorage- Parameters:
index- the indexvalue- the value to set- Mappings:
Namespace Name Mixin selector intermediary method_15210Lnet/minecraft/class_6490;method_15210(II)Vofficial bLans;b(II)Vnamed setLnet/minecraft/util/collection/PaletteStorage;set(II)V
-
get
public int get(int index) Returns the value atindexin this storage.- Specified by:
getin interfacePaletteStorage- Parameters:
index- the index- Returns:
- the value at
indexin this storage - Mappings:
Namespace Name Mixin selector intermediary method_15211Lnet/minecraft/class_6490;method_15211(I)Iofficial aLans;a(I)Inamed getLnet/minecraft/util/collection/PaletteStorage;get(I)I
-
getData
public long[] getData()Returns the backing data of this storage.- Specified by:
getDatain interfacePaletteStorage- Returns:
- the backing data of this storage
- Mappings:
Namespace Name Mixin selector intermediary method_15212Lnet/minecraft/class_6490;method_15212()[Jofficial aLans;a()[Jnamed getDataLnet/minecraft/util/collection/PaletteStorage;getData()[J
-
getSize
public int getSize()Returns the size of, or the number of elements in, this storage.- Specified by:
getSizein interfacePaletteStorage- Returns:
- the size of, or the number of elements in, this storage
- Mappings:
Namespace Name Mixin selector intermediary method_15215Lnet/minecraft/class_6490;method_15215()Iofficial bLans;b()Inamed getSizeLnet/minecraft/util/collection/PaletteStorage;getSize()I
-
getElementBits
public int getElementBits()Returns the number of bits each element in this storage uses.- Specified by:
getElementBitsin interfacePaletteStorage- Returns:
- the number of bits each element in this storage uses
- Mappings:
Namespace Name Mixin selector intermediary method_34896Lnet/minecraft/class_6490;method_34896()Iofficial cLans;c()Inamed getElementBitsLnet/minecraft/util/collection/PaletteStorage;getElementBits()I
-
forEach
Executes anactionon all values in this storage, sequentially.- Specified by:
forEachin interfacePaletteStorage- Mappings:
Namespace Name Mixin selector intermediary method_21739Lnet/minecraft/class_6490;method_21739(Ljava/util/function/IntConsumer;)Vofficial aLans;a(Ljava/util/function/IntConsumer;)Vnamed forEachLnet/minecraft/util/collection/PaletteStorage;forEach(Ljava/util/function/IntConsumer;)V
-
writePaletteIndices
public void writePaletteIndices(int[] out) - Specified by:
writePaletteIndicesin interfacePaletteStorage- Mappings:
Namespace Name Mixin selector intermediary method_39892Lnet/minecraft/class_6490;method_39892([I)Vofficial aLans;a([I)Vnamed writePaletteIndicesLnet/minecraft/util/collection/PaletteStorage;writePaletteIndices([I)V
-
copy
- Specified by:
copyin interfacePaletteStorage- Mappings:
Namespace Name Mixin selector intermediary method_39939Lnet/minecraft/class_6490;method_39939()Lnet/minecraft/class_6490;official dLans;d()Lans;named copyLnet/minecraft/util/collection/PaletteStorage;copy()Lnet/minecraft/util/collection/PaletteStorage;
-