Class DatCodec
java.lang.Object
com.datdeveloper.datmoddingapi.util.DatCodec
A utility class containing various useful codecs
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.world.level.ChunkPos>
A Codec for handling ChunkPos
This converts the chunkpos into an intstream, similar toBlockPos
static final com.mojang.serialization.Codec<UUID>
A Codec for handling UUID
Converts it into a string for storage -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<E>>
com.mojang.serialization.Codec<E>getEnumCodec
(Class<E> enumClass) A helper function to create a Codec that handles the given enum class
The resulting codec will convert the enum into a string for storage
-
Field Details
-
UUID_CODEC
A Codec for handling UUID
Converts it into a string for storage -
CHUNKPOS
public static final com.mojang.serialization.Codec<net.minecraft.world.level.ChunkPos> CHUNKPOSA Codec for handling ChunkPos
This converts the chunkpos into an intstream, similar toBlockPos
- See Also:
-
BlockPos
-
-
Constructor Details
-
DatCodec
public DatCodec()
-
-
Method Details
-
getEnumCodec
public static <E extends Enum<E>> com.mojang.serialization.Codec<E> getEnumCodec(Class<E> enumClass) A helper function to create a Codec that handles the given enum class
The resulting codec will convert the enum into a string for storage- Type Parameters:
E
- The Enum Type- Parameters:
enumClass
- The class of the enum- Returns:
- A Codec that handles the given enum class
-