Package net.minecraft.world.level.chunk
Class PalettedContainer<T>
java.lang.Object
net.minecraft.world.level.chunk.PalettedContainer<T>
- All Implemented Interfaces:
PalettedContainerRO<T>
,PaletteResize<T>
public class PalettedContainer<T>
extends Object
implements PaletteResize<T>, PalettedContainerRO<T>
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static final record
static interface
(package private) static final record
static class
Nested classes/interfaces inherited from interface net.minecraft.world.level.chunk.PalettedContainerRO
PalettedContainerRO.PackedData<T>, PalettedContainerRO.Unpacker<T,
C extends PalettedContainerRO<T>> -
Field Summary
Modifier and TypeFieldDescriptionprivate PalettedContainer.Data
<T> private final PaletteResize
<T> private static final int
private final PalettedContainer.Strategy
private final ThreadingDetector
-
Constructor Summary
ModifierConstructorDescriptionPalettedContainer
(IdMap<T> p_188035_, PalettedContainer.Strategy p_188036_, PalettedContainer.Configuration<T> p_188037_, BitStorage p_188038_, List<T> p_188039_) private
PalettedContainer
(IdMap<T> p_199928_, PalettedContainer.Strategy p_199929_, PalettedContainer.Data<T> p_199930_) PalettedContainer
(IdMap<T> p_188041_, T p_188042_, PalettedContainer.Strategy p_188043_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
acquire()
private static <T,
C extends PalettedContainerRO<T>>
com.mojang.serialization.Codec<C> codec
(IdMap<T> p_238428_, com.mojang.serialization.Codec<T> p_238429_, PalettedContainer.Strategy p_238430_, T p_238431_, PalettedContainerRO.Unpacker<T, C> p_238432_) static <T> com.mojang.serialization.Codec
<PalettedContainerRO<T>> codecRO
(IdMap<T> p_238419_, com.mojang.serialization.Codec<T> p_238420_, PalettedContainer.Strategy p_238421_, T p_238422_) static <T> com.mojang.serialization.Codec
<PalettedContainer<T>> codecRW
(IdMap<T> p_238372_, com.mojang.serialization.Codec<T> p_238373_, PalettedContainer.Strategy p_238374_, T p_238375_) copy()
void
count
(PalettedContainer.CountConsumer<T> p_63100_) private PalettedContainer.Data
<T> createOrReuseData
(PalettedContainer.Data<T> p_188052_, int p_188053_) protected T
get
(int p_63086_) get
(int p_63088_, int p_63089_, int p_63090_) void
private T
getAndSetUnchecked
(int p_63128_, int p_63129_, int p_63130_, T p_63131_) int
boolean
int
pack
(IdMap<T> p_188065_, PalettedContainer.Strategy p_188066_) void
read
(FriendlyByteBuf p_63119_) recreate()
void
release()
void
private void
private static <T> void
swapPalette
(int[] p_198190_, IntUnaryOperator p_198191_) private static <T> com.mojang.serialization.DataResult
<PalettedContainer<T>> unpack
(IdMap<T> p_188068_, PalettedContainer.Strategy p_188069_, PalettedContainerRO.PackedData<T> p_238258_) void
write
(FriendlyByteBuf p_63136_)
-
Field Details
-
MIN_PALETTE_BITS
private static final int MIN_PALETTE_BITS- See Also:
-
dummyPaletteResize
-
registry
-
data
-
strategy
-
threadingDetector
-
-
Constructor Details
-
PalettedContainer
public PalettedContainer(IdMap<T> p_188035_, PalettedContainer.Strategy p_188036_, PalettedContainer.Configuration<T> p_188037_, BitStorage p_188038_, List<T> p_188039_) -
PalettedContainer
private PalettedContainer(IdMap<T> p_199928_, PalettedContainer.Strategy p_199929_, PalettedContainer.Data<T> p_199930_) -
PalettedContainer
-
-
Method Details
-
acquire
public void acquire() -
release
public void release() -
codecRW
public static <T> com.mojang.serialization.Codec<PalettedContainer<T>> codecRW(IdMap<T> p_238372_, com.mojang.serialization.Codec<T> p_238373_, PalettedContainer.Strategy p_238374_, T p_238375_) -
codecRO
public static <T> com.mojang.serialization.Codec<PalettedContainerRO<T>> codecRO(IdMap<T> p_238419_, com.mojang.serialization.Codec<T> p_238420_, PalettedContainer.Strategy p_238421_, T p_238422_) -
codec
private static <T,C extends PalettedContainerRO<T>> com.mojang.serialization.Codec<C> codec(IdMap<T> p_238428_, com.mojang.serialization.Codec<T> p_238429_, PalettedContainer.Strategy p_238430_, T p_238431_, PalettedContainerRO.Unpacker<T, C> p_238432_) -
createOrReuseData
private PalettedContainer.Data<T> createOrReuseData(@Nullable PalettedContainer.Data<T> p_188052_, int p_188053_) -
onResize
- Specified by:
onResize
in interfacePaletteResize<T>
-
getAndSet
-
getAndSetUnchecked
-
getAndSet
-
set
-
set
-
get
- Specified by:
get
in interfacePalettedContainerRO<T>
-
get
-
getAll
- Specified by:
getAll
in interfacePalettedContainerRO<T>
-
read
-
write
- Specified by:
write
in interfacePalettedContainerRO<T>
-
unpack
private static <T> com.mojang.serialization.DataResult<PalettedContainer<T>> unpack(IdMap<T> p_188068_, PalettedContainer.Strategy p_188069_, PalettedContainerRO.PackedData<T> p_238258_) -
pack
public PalettedContainerRO.PackedData<T> pack(IdMap<T> p_188065_, PalettedContainer.Strategy p_188066_) - Specified by:
pack
in interfacePalettedContainerRO<T>
-
swapPalette
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSize
in interfacePalettedContainerRO<T>
-
maybeHas
- Specified by:
maybeHas
in interfacePalettedContainerRO<T>
-
copy
-
recreate
- Specified by:
recreate
in interfacePalettedContainerRO<T>
-
count
- Specified by:
count
in interfacePalettedContainerRO<T>
-