Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ore generation in 1.16.5, having problems with .withConfiguration and .configure

Featured Replies

Posted
public class OreGeneration {
	
	public static final Feature<OreFeatureConfig> KUNZITE_ORE = new OreFeature(OreFeatureConfig.CODEC);
	
	public static final ConfiguredFeature <?,?> KUNZITE_FEATURE = new ConfiguredFeature<?, ?>((KUNZITE_ORE).withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, 
			BlockInit.KUNZITE_ORE.get().defaultBlockState(), 6)).range(20).square().func_242731_b(20));
	
	public static void generateOre(final BiomeLoadingEvent event) {
		if (event.getCategory() == Category.SAVANNA) {
			event.getGeneration().getFeatures(Decoration.UNDERGROUND_ORES).add(() -> KUNZITE_FEATURE);
			
		}
	}
}

I have used multiple ways of incorporating ore generation into the game and they all seem to require ".withConfiguration"

this one doesnt require ".configure" though but most others do, and I have no idea why there is an error. theres usually a replacement solution but i cant seem to figure anything out

let me know if im missing anything

 

also this code heavily inspired by Beethoven92's better end generation, but i've tried many different simple ways of generating

57 minutes ago, ianm1647 said:

and I have no idea why there is an error.

It'd be useful if  you could've told the error

public static final ConfiguredFeature <?,?> KUNZITE_FEATURE = new ConfiguredFeature<?, ?>((KUNZITE_ORE).withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockInit.KUNZITE_ORE.get().defaultBlockState(), 6)).range(20).square().func_242731_b(20));

this should throw an error as you call RegistryObject#get before the objects have been registered (i.e.: in static initialization). I'd instantiate the ore features in the common setup event

Edited by kiou.23

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.