I am experimenting with the DatapackBuiltinEntriesProvider, and I am trying to add a custom structure for the taiga village structure template pool. The json file generates properly, however the result doesn't actually show in the taiga village. I'm looking at the official forge documentation and the forge GitHub, to see how things are working. Here is a snippet of my code, in the rest of the project I made sure to replace the "examplemod" mod ID,
...
modEventBus.addListener(this::onGatherData);
}
public void onGatherData(GatherDataEvent event) {
event.getGenerator().addProvider(
event.includeServer(),
(DataProvider.Factory<DatapackBuiltinEntriesProvider>) output -> new DatapackBuiltinEntriesProvider(
output,
event.getLookupProvider(),
new RegistrySetBuilder().add(Registries.TEMPLATE_POOL, this::addHut),
// Minecraft because this is modifying a minecraft template pool.
Set.of("minecraft")
)
);
}
public void addHut(BootstapContext<StructureTemplatePool> context) {
HolderGetter<StructureTemplatePool> poolHolderGetter = context.lookup(Registries.TEMPLATE_POOL);
Holder<StructureTemplatePool> emptyPool = poolHolderGetter.getOrThrow(Pools.EMPTY);
StructurePoolElement hut = StructurePoolElement.legacy("arcana:witch_hut").apply(StructureTemplatePool.Projection.RIGID);
context.register(ResourceKey.create(Registries.TEMPLATE_POOL, new ResourceLocation("village/taiga/houses")), new StructureTemplatePool(emptyPool, List.of(Pair.of(hut, 2))));
}
...
What this code should do to my knowledge is create a new structure template pool with only the given structure as shown by the generated json:
"elements": [
{
"element": {
"element_type": "minecraft:legacy_single_pool_element",
"location": "arcana:witch_hut",
"processors": {
"processors": []
},
"projection": "rigid"
},
"weight": 2
}
],
"fallback": "minecraft:empty"
}
With my .nbt structure file contained in "resources/data/arcana/structures/witch_hut.nbt"
However, in the end this structure doesn't show up at all. Pardon me but if this is a very simple issue, I would appreciate being redirected to any resources or tips that may be helpful in figuring out myself how to fix this issue. I've been refraining from watching YouTube tutorials for the longest point because I am trying to actually develop the skillset to go through code and documentation to learn this myself.