Jump to content

1.16.4 Ore generation


ARKseal

Recommended Posts

You need to register a configured feature. to do so, you can create a field MY_ORE_CONFIG, of type ConfiguredFeature<?, ?>.

Then in the common setup, you want to call Registry.register(), passing in the type of world gen registry (for ores, that's WorldGenRegistries.CONFIGURED_FEATURES), than a string that will be the registry key, and then the actual configured feature. you may want to take a look at the Features class, and see how it creates configured features for ores.

For any standard ore you'll use Feature.ORE.withConfiguration(), and pass the feature configurations, which would be a new instance of a OreFeatureConfig.

Again, looking at the Features class, and how that class register Configured Features should really simplify thing.

 

After you have the Configured Feature Registered, you need to add it to the biomes generation algorithm.

You can do this in the BiomeLoadingEvent. simply check the biome category for the biomes that you want (for instance, if you're adding the ore to the overworld, than don't add it to the Nether and End biomes). you can call BiomeLoadingEvent#getGeneration(), to get the biome's generation algorithm, from there you can call BiomeGenerationSettingsBuilder#getFeatures() to get all the features, and you'd need to pass the Generation Stage, for commom ores: GenerationStage.Decoration.Underground. and from there you can call .add() to add your configured feature (note: .add() will expect a Supplier of a ConfiguredFeature)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.