fabric how to generate ores

Solutions on MaxInterview for fabric how to generate ores by the best coders in the world

showing results for - "fabric how to generate ores"
Matteo
10 May 2016
1public class ExampleMod implements ModInitializer {
2  private static ConfiguredFeature<?, ?> ORE_WOOL_OVERWORLD = Feature.ORE
3    .configure(new OreFeatureConfig(
4      OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
5      Blocks.WHITE_WOOL.getDefaultState(),
6      9)) // vein size
7    .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(
8      0,
9      0,
10      64)))
11    .spreadHorizontally()
12    .repeat(20); // number of veins per chunk
13 
14  @Override
15  public void onInitialize() {
16    RegistryKey<ConfiguredFeature<?, ?>> oreWoolOverworld = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN,
17        new Identifier("tutorial", "ore_wool_overworld"));
18    Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, oreWoolOverworld.getValue(), ORE_WOOL_OVERWORLD);
19    BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, oreWoolOverworld);
20  }
21}