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

it says Cannot resolve method 'withConfiguration' in 'Feature' I tried everthing and i can not fix this error 

help

 

@LexManos

@diesieben07

 

i am new to forge hand coding btw

 

code:

package com.jerios.pearlarmor.world.gen;

import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.WorldGenRegistries;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.placement.ConfiguredPlacement;
import net.minecraft.world.gen.placement.Placement;
import net.minecraft.world.gen.placement.TopSolidRangeConfig;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import com.jerios.pearlarmor.world.gen.OreType;

public class ModOreGen {
    public static void generateOres(final BiomeLoadingEvent event) {
        for (OreType ore : OreType.values()) {
            OreFeatureConfig oreFeatureConfig = new OreFeatureConfig(
                    OreFeatureConfig.FillerBlockType.NATURAL_STONE,
                    ore.getBlock().get().defaultBlockState(), ore.getMaxHeight());

            ConfiguredPlacement<TopSolidRangeConfig> configuredPlacement = Placement.RANGE.configured(
                    new TopSolidRangeConfig(ore.getMinHeight(), ore.getMinHeight(), ore.getMaxHeight()));


        }
    }
    private static ConfiguredFeature<?, ?> registerOreFeature(OreType ore, OreFeatureConfig oreFeatureConfig,
                                                              ConfiguredPlacement configuredPlacement, BlockWithContextConfig blockWithContextConfig) {
        return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, ore.getBlock().get().getRegistryName(),
                Feature.ORE.withConfiguration(oreFeatureConfig).withPlacement(configuredPlacement) // line that is giving trouble fix soon
                        .square().count(ore.getMaxVeinSize()));
    }
}

 

Edited by Unpuzzledmind32

  • Author
5 minutes ago, diesieben07 said:

What on earth is "hand coding"?

Have you looked at the Feature class? It is pretty obvious what the method name you need is.

well hand coding is where you don't make the code, like making it with a program like mcreator

 what method name do i need?

 

i am sorry i am just very new to coding 

Edited by Unpuzzledmind32

  • Author
4 minutes ago, diesieben07 said:

Okay so like... just coding? :D

Have you done what I told you?

 

1: yes

 

2: yes i have and i still have no idea what to do lol

😁

Edited by Unpuzzledmind32

  • Author
2 minutes ago, diesieben07 said:

So you have looked at the literally two public instance methods that Feature provides and you cannot figure out which one you need?

No i cannot figure out which one i need

 

which one do i need?

Edited by Unpuzzledmind32

  • Author
14 minutes ago, diesieben07 said:

Only two are public and not static.

this is what my Feature class looks like

 

do you mean two are private and almost all of them are static

am i not seing somthing?

Edited by Unpuzzledmind32

  • Author
6 minutes ago, diesieben07 said:

Do not post code that is under copyright.

I mean two methods are both public and not static.

i am sorry but i do not see it

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.