yarn icon indicating copy to clipboard operation
yarn copied to clipboard

`REGISTRY_CODEC` vs `ENTRY_CODEC` vs `REGISTRY_ENTRY_CODEC`

Open enbrain opened this issue 2 years ago • 2 comments

Currently, three different names are used for Codec<RegistryEntry<T>>. Fixing inconsistency would be nice.

REGISTRY_CODEC is used for

  • net.minecraft.structure.StructureSet.REGISTRY_CODEC
  • net.minecraft.structure.pool.StructurePool.REGISTRY_CODEC
  • net.minecraft.structure.processor.StructureProcessorType.REGISTRY_CODEC
  • net.minecraft.world.biome.Biome.REGISTRY_CODEC
  • net.minecraft.world.dimension.DimensionType.REGISTRY_CODEC
  • net.minecraft.world.gen.carver.ConfiguredCarver.REGISTRY_CODEC
  • net.minecraft.world.gen.chunk.ChunkGeneratorSettings.REGISTRY_CODEC
  • net.minecraft.world.gen.feature.ConfiguredFeature.REGISTRY_CODEC
  • net.minecraft.world.gen.feature.PlacedFeature.REGISTRY_CODEC

ENTRY_CODEC is used for

  • net.minecraft.world.gen.FlatLevelGeneratorPreset.ENTRY_CODEC
  • net.minecraft.world.gen.WorldPreset.ENTRY_CODEC
  • net.minecraft.world.gen.structure.StructureType.ENTRY_CODEC

REGISTRY_ENTRY_CODEC is used for

  • net.minecraft.util.math.noise.DoublePerlinNoiseSampler.NoiseParameters.REGISTRY_ENTRY_CODEC
  • net.minecraft.world.gen.densityfunction.DensityFunction.REGISTRY_ENTRY_CODEC

enbrain avatar Apr 20 '22 21:04 enbrain

Another old usage of REGISTRY_CODEC is where a typed object has its type read from the registry with id and then dispatches the rest of the object with the type. Need to distinguish them as well. #2134

liach avatar Apr 20 '22 23:04 liach

Could these two types of registry codecs be distinguished as lookup and dispatch codecs?

haykam821 avatar Apr 21 '22 00:04 haykam821