Package net.minecraft.util.palette
Class PalettedContainer<T>
- java.lang.Object
-
- net.minecraft.util.palette.PalettedContainer<T>
-
- All Implemented Interfaces:
IResizeCallback<T>
public class PalettedContainer<T> extends java.lang.Object implements IResizeCallback<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PalettedContainer.ICountConsumer<T>
-
Field Summary
Fields Modifier and Type Field Description private int
bits
private T
defaultValue
private IResizeCallback<T>
dummyPaletteResize
private IPalette<T>
globalPalette
private java.util.concurrent.locks.ReentrantLock
lock
private IPalette<T>
palette
private java.util.function.Function<CompoundNBT,T>
reader
private ObjectIntIdentityMap<T>
registry
protected BitArray
storage
private java.util.function.Function<T,CompoundNBT>
writer
-
Constructor Summary
Constructors Constructor Description PalettedContainer(IPalette<T> p_i48961_1_, ObjectIntIdentityMap<T> p_i48961_2_, java.util.function.Function<CompoundNBT,T> p_i48961_3_, java.util.function.Function<T,CompoundNBT> p_i48961_4_, T p_i48961_5_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquire()
void
count(PalettedContainer.ICountConsumer<T> p_225497_1_)
protected T
get(int p_186015_1_)
T
get(int p_186016_1_, int p_186016_2_, int p_186016_3_)
T
getAndSet(int p_222641_1_, int p_222641_2_, int p_222641_3_, T p_222641_4_)
protected T
getAndSet(int p_222643_1_, T p_222643_2_)
T
getAndSetUnchecked(int p_222639_1_, int p_222639_2_, int p_222639_3_, T p_222639_4_)
private static int
getIndex(int p_186011_0_, int p_186011_1_, int p_186011_2_)
int
getSerializedSize()
boolean
maybeHas(java.util.function.Predicate<T> p_235963_1_)
int
onResize(int p_onResize_1_, T p_onResize_2_)
void
read(ListNBT p_222642_1_, long[] p_222642_2_)
void
read(PacketBuffer p_186010_1_)
void
release()
protected void
set(int p_186014_1_, T p_186014_2_)
private void
setBits(int p_186012_1_)
private void
setBits(int bitsIn, boolean forceBits)
void
write(CompoundNBT p_196963_1_, java.lang.String p_196963_2_, java.lang.String p_196963_3_)
void
write(PacketBuffer p_186009_1_)
-
-
-
Field Detail
-
dummyPaletteResize
private final IResizeCallback<T> dummyPaletteResize
-
registry
private final ObjectIntIdentityMap<T> registry
-
reader
private final java.util.function.Function<CompoundNBT,T> reader
-
writer
private final java.util.function.Function<T,CompoundNBT> writer
-
defaultValue
private final T defaultValue
-
storage
protected BitArray storage
-
bits
private int bits
-
lock
private final java.util.concurrent.locks.ReentrantLock lock
-
-
Constructor Detail
-
PalettedContainer
public PalettedContainer(IPalette<T> p_i48961_1_, ObjectIntIdentityMap<T> p_i48961_2_, java.util.function.Function<CompoundNBT,T> p_i48961_3_, java.util.function.Function<T,CompoundNBT> p_i48961_4_, T p_i48961_5_)
-
-
Method Detail
-
acquire
public void acquire()
-
release
public void release()
-
getIndex
private static int getIndex(int p_186011_0_, int p_186011_1_, int p_186011_2_)
-
setBits
private void setBits(int p_186012_1_)
-
setBits
private void setBits(int bitsIn, boolean forceBits)
-
onResize
public int onResize(int p_onResize_1_, T p_onResize_2_)
- Specified by:
onResize
in interfaceIResizeCallback<T>
-
getAndSetUnchecked
public T getAndSetUnchecked(int p_222639_1_, int p_222639_2_, int p_222639_3_, T p_222639_4_)
-
set
protected void set(int p_186014_1_, T p_186014_2_)
-
get
public T get(int p_186016_1_, int p_186016_2_, int p_186016_3_)
-
get
protected T get(int p_186015_1_)
-
read
public void read(PacketBuffer p_186010_1_)
-
write
public void write(PacketBuffer p_186009_1_)
-
read
public void read(ListNBT p_222642_1_, long[] p_222642_2_)
-
write
public void write(CompoundNBT p_196963_1_, java.lang.String p_196963_2_, java.lang.String p_196963_3_)
-
getSerializedSize
public int getSerializedSize()
-
maybeHas
public boolean maybeHas(java.util.function.Predicate<T> p_235963_1_)
-
count
public void count(PalettedContainer.ICountConsumer<T> p_225497_1_)
-
-