Class RegistryCodecTest

java.lang.Object
net.minecraftforge.debug.misc.RegistryCodecTest

public class RegistryCodecTest extends Object
This test mod show a few example usages of IForgeRegistry.getCodec() to serialize and deserialize registry entries 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 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>> CODEC
      This Codec can serialize and deserialize a Pair<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