[1.18.2] Biome Encoding Fails when Quark is Present
superckl opened this issue ยท 2 comments
This is using:
AutoRegLib-1.7-53
Quark-3.2-346
biometweaker-1.18.2-4.0.10
BiomeTweaker allows users to dump all registered biomes to to a folder as json files using the direct codec Biome.DIREC_CODEC
. However, when quark is present, this fails for every biome giving errors similar to
Mixed type list: element Direct{Placed Direct{Configured: vazkii.quark.base.world.DeferredFeature@78395e28: net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration@548ca7e1}} had type DIRECT, but list is of type REFERENCE
See the end of this log file; these messages are obtained from the partial result of the failed encode. The issue was reported in superckl/BiomeTweaker#280
I'm not really sure what quark is adding to the biomes that causes the codec fail, so I am reproducing the issue here so we can work on fixing this. The relevant code the produces output in BiomeTweaker is here.
Looks like the issue is possibly here. Quark seems to be using direct codecs, whereas vanilla features use Holder.Reference
. See net.minecraft.core.MappedRegistry.registerMapping
.
I think the easiest way to address this is to use BuiltinRegistries.register
rather than Registry.register
here and then store the holders that are returned rather than the placed features themselves. This way you can avoid ever creating holders yourself.