Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

World Generation via BiomeModifications on NeoForge does not work and another thing #480

Open
Craftjakob opened this issue Feb 27, 2024 · 0 comments
Labels
bug Something isn't working priority: high This needs to be worked on and reviewed ASAP

Comments

@Craftjakob
Copy link

I tried many times in different versions to set up the World Generation for ores, etc., in Fabric and Forge it works, but not in NeoForge.

Example code, that I use, which works in Fabric and Forge:

BiomeModifications.addProperties((biomeContext, mutable) -> {
            if (biomeContext.hasTag(BiomeTags.IS_END)) {
                mutable.getGenerationProperties().addFeature(
                        GenerationStep.Decoration.UNDERGROUND_DECORATION,
                        ResourceKey.create(Registries.PLACED_FEATURE,
                                new ResourceLocation(EXAMPLE.MOD_ID "example_placed"))
                );
            }
});

And a question: there is another addFeture methode, where you need to but a PlacedFeature inside a Holder, but how can I use that? In Forge's dategen you never need a Holder with a PlacedFeature.
Only that for BiomeModifers:

private static Direct<PlacedFeature> feature(BootstapContext<BiomeModifier> context, ResourceKey<PlacedFeature> placedFeature) {
      return HolderSet.direct(context.lookup(Registries.PLACED_FEATURE).getOrThrow(placedFeature));
}

Another thing, that is annoying is a feature in the CreativeTabRegistry.
Here you need to give a CreativeModeTab, but If you want to use it like that: 'CreativeModeTabs.COMBAT', it does not work.
I get around the problem by using this: 'CreativeModeTabs.allTabs().get(7)'

CreativeTabRegistry.modifyBuiltin(CreativeModeTabs.allTabs().get(10), (flags, output, canUseGameMasterBlocks) -> {
            output.acceptAfter(Items.NETHERITE_INGOT, EXAMPLE_MOD_ITEM);
});

In Forge, you can use 'CreativeModeTabs.COMBAT':

private void addCreative(BuildCreativeModeTabContentsEvent event) {
		if (event.getTabKey() == CreativeModeTabs.COMBAT) {
		              event.getEntries().putAfter(new ItemStack(Items.NETHERITE_INGOT), new ItemStack(EXAMPLE_MOD_ITEM), TabVisibility.PARENT_AND_SEARCH_TABS);
		}
}

Hopefully you can implement or fix this, that would be very great!

@shedaniel shedaniel added bug Something isn't working priority: high This needs to be worked on and reviewed ASAP labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high This needs to be worked on and reviewed ASAP
Projects
None yet
Development

No branches or pull requests

2 participants