Productive Trees

Productive Trees

5M Downloads

Not creating datapacks correctly

Cheaterpaul opened this issue ยท 2 comments

commented

ProductiveTrees seems to have a dynamic datapack, that generates the resources on runtime.

Which is rather unorthodox, but to generate the new data you create a new HolderLookup.Provider, which only contains the default vanilla registry objects and no other modded one. This way the data pack generation failes to resolve id.

private static void registerDataGen() {
generator = new DataGenerator(TreeFinder.DYNAMIC_RESOURCE_PATH, SharedConstants.getCurrentVersion(), true);
CompletableFuture<HolderLookup.Provider> lookupProvider = CompletableFuture.supplyAsync(VanillaRegistries::createLookup, Util.backgroundExecutor());
TreeRegistrator.registerDatagen(generator, lookupProvider);
}

I am not sure, why productivetrees generates the resources on runtime. It looks to me like the resources could be generated beforehand and not on runtime. That way you have access to the GatherDataEvent#getLookupProvider to obtain a HolderLookup.Provider with all existing registry objects.

commented

why is vampirism having a seizure with this when no other mod is?

commented

Experiencing a similar bug. I've added Vampirism to my Direwolf20 1.21 server and it's crashing with productivetrees. Interestingly, I can add it to version 1.4.1 of the same modpack, it only breaks with version 1.7.0.

I created a bug with vampirism as I wasn't sure where the issue was but linking it here as it seems to be productivetrees is the source.

TeamLapen/Vampirism#1460