Package net.minecraft.util
Class SimpleBitStorage
java.lang.Object
net.minecraft.util.SimpleBitStorage
- All Implemented Interfaces:
BitStorage
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final long[]
private final int
private final int
private final int
private static final int[]
private final long
private final int
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleBitStorage
(int pBits, int pSize) SimpleBitStorage
(int pBits, int pSize, int[] pData) SimpleBitStorage
(int pBits, int pSize, long[] pData) -
Method Summary
Modifier and TypeMethodDescriptionprivate int
cellIndex
(int pIndex) copy()
int
get
(int p_184729_) Gets the entry at the given indexvoid
getAll
(IntConsumer p_184734_) int
getAndSet
(int p_184731_, int p_184732_) int
getBits()
long[]
getRaw()
int
getSize()
void
set
(int p_184742_, int p_184743_) Sets the entry at the given location to the given valuevoid
unpack
(int[] p_198168_)
-
Field Details
-
MAGIC
private static final int[] MAGIC -
data
private final long[] data -
bits
private final int bits -
mask
private final long mask -
size
private final int size -
valuesPerLong
private final int valuesPerLong -
divideMul
private final int divideMul -
divideAdd
private final int divideAdd -
divideShift
private final int divideShift
-
-
Constructor Details
-
SimpleBitStorage
public SimpleBitStorage(int pBits, int pSize, int[] pData) -
SimpleBitStorage
public SimpleBitStorage(int pBits, int pSize) -
SimpleBitStorage
public SimpleBitStorage(int pBits, int pSize, @Nullable long[] pData)
-
-
Method Details
-
cellIndex
private int cellIndex(int pIndex) -
getAndSet
public int getAndSet(int p_184731_, int p_184732_) - Specified by:
getAndSet
in interfaceBitStorage
-
set
public void set(int p_184742_, int p_184743_) Description copied from interface:BitStorage
Sets the entry at the given location to the given value- Specified by:
set
in interfaceBitStorage
-
get
public int get(int p_184729_) Description copied from interface:BitStorage
Gets the entry at the given index- Specified by:
get
in interfaceBitStorage
-
getRaw
public long[] getRaw()- Specified by:
getRaw
in interfaceBitStorage
-
getSize
public int getSize()- Specified by:
getSize
in interfaceBitStorage
-
getBits
public int getBits()- Specified by:
getBits
in interfaceBitStorage
-
getAll
- Specified by:
getAll
in interfaceBitStorage
-
unpack
public void unpack(int[] p_198168_) - Specified by:
unpack
in interfaceBitStorage
-
copy
- Specified by:
copy
in interfaceBitStorage
-