So, after a lot of digging around the forge/minecraft classes i managed to figure it out how the Ore Gen is working.
The feature registering remains similar:
public static void initGen() {
Registry.register(
WorldGenRegistries.field_243653_e /* Feature Registering */,
ModBlocks.ADAMANTINE_ORE.getId() /* Resource Location */,
Feature.field_236289_V_ /* no_surface_ore */.withConfiguration(
new OreFeatureConfig(
OreFeatureConfig.FillerBlockType.field_241882_a /* base_stone_overworld */,
ModBlocks.ADAMANTINE_ORE.get().getDefaultState() */,
64
)
).withPlacement(Placement.field_242910_o /* depth */ .configure(
new DepthAverageConfig(12, 12)
)).func_242728_a() /* spreadHorizontally */ .func_242731_b(1) /* repeat */
);
}
The most trick part was adding that feature in the already configured features of an biome:
public static void setupGen() {
for (Map.Entry<RegistryKey<Biome>, Biome> biome : WorldGenRegistries.field_243657_i.func_239659_c_() /* Collection of Biome Entries */) {
if (!biome.getValue().getCategory().equals(Biome.Category.NETHER) && !biome.getValue().getCategory().equals(Biome.Category.THEEND)) {
addFeatureToBiome(
biome.getValue(),
GenerationStage.Decoration.UNDERGROUND_ORES,
WorldGenRegistries.field_243653_e.getOrDefault(ModBlocks.ADAMANTINE_ORE.getId())
);
}
}
}
public static void addFeatureToBiome(Biome biome, GenerationStage.Decoration decoration, ConfiguredFeature<?, ?> configuredFeature) {
List<List<Supplier<ConfiguredFeature<?, ?>>>> biomeFeatures = new ArrayList<>(
biome.func_242440_e().func_242498_c() /* List of Configured Features */
);
while (biomeFeatures.size() <= decoration.ordinal()) {
biomeFeatures.add(Lists.newArrayList());
}
List<Supplier<ConfiguredFeature<?, ?>>> features = new ArrayList<>(biomeFeatures.get(decoration.ordinal()));
features.add(() -> configuredFeature);
biomeFeatures.set(decoration.ordinal(), features);
/* Change field_242484_f that contains the Configured Features of the Biome*/
ObfuscationReflectionHelper.setPrivateValue(BiomeGenerationSettings.class, biome.func_242440_e(), biomeFeatures, "field_242484_f");
}}
Actually it seems that there's no proper way of doing this by now, since i needed to use the "setPrivateValue".
It's not ideal ... but it works.
Thanks a lot for the guidance.