Jump to content

Custom Spawn Ore in My Biome


Kexibq

Recommended Posts

public static void generateOres(final BiomeLoadingEvent event) { for (OreType ore : OreType.values()) { OreFeatureConfig oreFeatureConfig = new OreFeatureConfig( OreFeatureConfig.FillerBlockType.BASE_STONE_OVERWORLD, ore.getBlock().get().getDefaultState(), ore.getMaxVeinSize()); // bottomOffset -> minimum height for the ore // maximum -> minHeight + maximum = top level (the vertical expansion of the ore, it grows x levels from bottomOffset) // topOffset -> subtracted from the maximum to give actual top level // ore effectively exists from bottomOffset to (bottomOffset + maximum - topOffset) ConfiguredPlacement<TopSolidRangeConfig> configuredPlacement = Placement.RANGE.configure( new TopSolidRangeConfig(ore.getMinHeight(), ore.getMinHeight(), ore.getMaxHeight())); ConfiguredFeature<?, ?> oreFeature = registerOreFeature(ore, oreFeatureConfig, configuredPlacement); RegistryKey<Biome> key = RegistryKey.getOrCreateKey(Registry.BIOME_KEY, event.getName()); Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes(key); if(types.contains(BiomeDictionary.Type.MAGICAL.HOT.DRY.RARE)) event.getGeneration().withFeature(GenerationStage.Decoration.UNDERGROUND_ORES, oreFeature); } }

 

I tried to use BiomeDictionary from my code about FlowersGeneration but this didnt work and ore spawn also in savanna for example. (My biome has type Magical, Hor, Dry, Rare and it is Forest Biome)

i have only 5 days experience of modding) Can someone help me with ore gen pls

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.



×
×
  • Create New...

Important Information

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