Jump to content

[SOLVED] [1.16.5] Setting up ore generation


starvingslvt

Recommended Posts

I've been following a modding tutorial made for 1.16, and I've already come across my fair share of functions with name changes and whatnot. But, for the life of me I cannot seem to figure out ore generation. The issue is with .withPlacement, which the person in the tutorial uses, however, it's no longer a thing. I can't find anything that does the same function as .withPlacement. I had already had to replace .withFeature, which the person in the tutorial uses, with .addFeature as well as .withConfiguration with .configured.

import net.minecraft.block.BlockState;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.feature.template.RuleTest;
import net.minecraft.world.gen.placement.Placement;
import net.minecraft.world.gen.placement.TopSolidRangeConfig;
import net.minecraftforge.event.world.BiomeLoadingEvent;

public class FeatureInit {
	public static void addOre(final BiomeLoadingEvent event, RuleTest rule, BlockState state, int veinSize, int minHeight, int maxHeight, int amount) {
		event.getGeneration().addFeature(GenerationStage.Decoration.UNDERGROUND_ORES,
				Feature.ORE.configured(new OreFeatureConfig(rule, state, veinSize),
						new OreFeatureConfig(Placement.RANGE.configured(new TopSolidRangeConfig(minHeight, 0, maxHeight)))));
	}
}

Edit 1: .withPlacement is now .decorated, and func_242731_b is .count

Edited by starvingslvt
The issue has been resolved
  • Thanks 1
Link to comment
Share on other sites

  • starvingslvt changed the title to [SOLVED] [1.16.5] Setting up ore generation

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.