Changes

m
Line 92: Line 92:  
As previously mentioned, we can use <code>Codec.INT</code> for the integer codec, and <code>Registry.ITEM</code> for the Item codec. We don't have a builtin codec for list-of-blockpos, but we can use BlockPos.CODEC to create one.
 
As previously mentioned, we can use <code>Codec.INT</code> for the integer codec, and <code>Registry.ITEM</code> for the Item codec. We don't have a builtin codec for list-of-blockpos, but we can use BlockPos.CODEC to create one.
   −
== Lists ==
+
==Lists==
 
The <code>Codec#listOf</code> instance method can be used to generate a codec for a List from an existing codec:
 
The <code>Codec#listOf</code> instance method can be used to generate a codec for a List from an existing codec:
    
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">
 
// BlockPos.CODEC is a Codec<BlockPos>
 
// BlockPos.CODEC is a Codec<BlockPos>
Codec<List<BlockPos>> = BlockPos.CODEC.listOf();
+
Codec<List<BlockPos>> blockPosListCodec = BlockPos.CODEC.listOf();
 
</syntaxhighlight>
 
</syntaxhighlight>