Register the configuredfeatures under Forbidden Arcanus's modid and before BiomeLoadingEvent
TelepathicGrunt opened this issue ยท 3 comments
I was helping someone trying to spawn Forbidden Arcanus's trees with worldgen datapacks and we couldn't get "forbidden_arcanus:mysterywood" to work. I looked at the code to make sure it was correct and I see the register method being used:
The register method just takes the "mysterywood" name passed in and just uses that to register which means Minecraft automatically append "minecraft:" to the front. So it actually "minecraft:mysterywood" in the registry. A quick change of name
to new ResourceLocation(ForbiddenArcanus.MOD_ID, name)
will fix this. Be sure to double check the other register methods in case they are doing the same issue.
I hope this helps!
Also, please classload ModConfiguredFeatures in FMLCommonSetupEvent as the features needs to be registered before the world is clicked on as otherwise, people cannot grab your configuredfeatures with datapacks. Right now, I breakpointed the mod and the tree configuredfeatures are being registered during BiomeLoadingEvent which is way too late because that event fires after worldgen datapacks are parsed. Which makes the trees actually "unregistered" configuredfeatures and could also nuke registered ones from biomes in rare cases too.
Here's an example of what I do to register my configuredfeatures safely and early enough: https://github.com/TelepathicGrunt/RepurposedStructures/blob/f6ef1a0b4aac6f29f489717252fe451a0d655c10/src/main/java/com/telepathicgrunt/repurposedstructures/RepurposedStructures.java#L128