Registry adapters do not work with dynamic registries
Abbie5 opened this issue ยท 5 comments
Using this code: (BiomeEmiStack is my own class)
@Override
public void initialize(EmiInitRegistry registry) {
Registry<Biome> biomeRegistry = Minecraft.getInstance().level.registryAccess().registryOrThrow(Registries.BIOME);
registry.addRegistryAdapter(EmiRegistryAdapter.simple(Biome.class, biomeRegistry, BiomeEmiStack::of));
}
Produces this error upon joining a world:
[20:10:00] [Thread-12/ERROR] (EMI) [EMI] java.lang.NullPointerException: Cannot invoke "net.minecraft.core.Registry.getTag(net.minecraft.tags.TagKey)" because "registry" is null
at dev.emi.emi.EmiUtil.values(EmiUtil.java:63)
at dev.emi.emi.registry.EmiTags.reloadTags(EmiTags.java:249)
at dev.emi.emi.registry.EmiTags.reload(EmiTags.java:243)
at dev.emi.emi.runtime.EmiReloadManager$ReloadWorker.run(EmiReloadManager.java:171)
at java.base
Full log:
latest.log
Versions used:
- emi 1.1.5+1.20.1+fabric
- fabric-api 0.91.0+1.20.1
- fabricloader 0.14.25
- java 17
- minecraft 1.20.1
Can you upload a log? I thought I fixed this and marked it as fixed in 1.1.7 but I don't think I actually did
tested with EMI 1.1.7+1.19.2, still occurs. log attached
latest.log