Package net.minecraftforge.debug.misc
Class RegistryCodecTest
java.lang.Object
net.minecraftforge.debug.misc.RegistryCodecTest
This test mod show a few example usages of
IForgeRegistry.getCodec()
to serialize and deserialize IForgeRegistryEntry
to json or nbt.
There are 4 tested cases :
1. json -> Pair
2. Pair -> nbt
3. Pair -> compressed json
4. compressed json -> Pair
For each test the result will be logged.-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
CODEC
private static final com.mojang.serialization.Codec<com.mojang.datafixers.util.Pair<Block,Item>> CODECThis Codec can serialize and deserialize aPair<Item, Block>
. The resulting JSON (or NBT equivalent) will have this structure:{ "block": "block_registry_name", "item": "item_registry_name" }
-
-
Constructor Details
-
RegistryCodecTest
public RegistryCodecTest()
-
-
Method Details
-
commonSetup
-