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.

Featured Replies

Posted

I'm updating my mod from 1.19.2 to 1.20.X, going to 1.19.3 as an intermediate step so that I can ensure my data generators work correctly before updating the rest.

I have many lines to create configured features that look like this:

ALPINE_ROCK = new ConfiguredFeature<>(ModGeneration.OUTCROP.get(), new BlockStateConfiguration(Blocks.STONE.defaultBlockState()));
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new ResourceLocation(Main.MOD_ID, "alpine_rock"), ALPINE_ROCK);

Now I am on 1.19.3, BuiltinRegistries.CONFIGURED_FEATURE no longer exists. What is the proper way to register configured features in this version? Can this even still be done in code, or is this one of the "dynamic registries" affected by the registry overhaul? If it can no longer be done in code, what is necessary to do it using JSON?

It is now done with datagen, you will need to add a `DatapackBuiltinEntriesProvider` to your data generator. The `RegistrySetBuilder` argument should look something like this:

private static final RegistrySetBuilder BUILDER = new RegistrySetBuilder()
  .add(Registries.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap)
  .add(Registries.PLACED_FEATURE, ModPlacedFeatures::bootstrap);

with your `ModConfiguredFeatures` class based on this rough template:

public static final ResourceKey<ConfiguredFeature<?, ?>> EXAMPLE = createKey("example");
// Add more keys here

public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context) {
  HolderGetter<ConfiguredFeature<?, ?>> configured = context.lookup(Registries.CONFIGURED_FEATURE);
  HolderGetter<PlacedFeature> placed = context.lookup(Registries.PLACED_FEATURE);

  register(context, EXAMPLE, Feature.EXAMPLE_FEATURE, new ExampleConfiguration(args));
  // Register more features here
}

private static ResourceKey<ConfiguredFeature<?, ?>> createKey(String name) {
  return ResourceKey.create(Registries.CONFIGURED_FEATURE, new ResourceLocation("modid", name));
}

private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> key, F feature, FC config) {
  context.register(key, new ConfiguredFeature<>(feature, config));
}

Hope this helps get you started :)

  • 2 months later...

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.