Jump to content

[Solved] [1.16.5] Custom World Type Nether


NorthWestWind

Recommended Posts

I want to make the nether only generates features like fortresses, bastions but not bones, and remove all other terrains and the bedrock roof while still keeping the biomes and lava.

The problem is that I don't even know how I can edit them.

Edited by NorthWestWind
Link to comment
Share on other sites

So, removing some of the features from nether biomes is quite simple, you would need to handle the BiomeLoadingEvent, retrieve the features you don't want from each Nether biome and remove them from the feature list. Example on how to use the BiomeLoadingEvent to add or remove features here: https://github.com/Beethoven92/BetterEndForge/blob/master/src/main/java/mod/beethoven92/betterendforge/common/event/forge/BiomeModification.java

You should specify a bit more what do you mean by "remove all other terrains"...but for things like that and removing the bedrock ceiling there is no easy or mod-compatible way to achieve them. You would need to create a custom DimensionSettings object for the Nether and replace the vanilla one. Useful classes to look at are: NoiseChunkGenerator and DimensionSettings

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Link to comment
Share on other sites

Thank you for giving me examples, will definitely try it very soon.

And by "remove all other terrains", I mean I want nether biomes to generate on islands, like in the end (but smaller).

Also about the DimensionSettings thing, I would actually like to override the chunk generator of the nether instead so I can take full control about the nether generation. Is there any way to achieve this?

Edited by NorthWestWind
Link to comment
Share on other sites

You need to look how the floating islands world preset is generated then (in the DimensionSettings class you can see the settings used by the floating islands world type)..to override the Nether chunk generator you would have to create a new NoiseChunkGenerator instance. Look at the getNetherChunkGenerator method in the DimensionType class..however instead of trying to replace the vanilla nether, unless you really want to do that, i would go for a custom world type which generates how you want (which would be far easier and would not require core modding)

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Link to comment
Share on other sites

After looking around a little more, I found the way to use custom chunk generator in the nether.

It turns out ForgeWorldType.IChunkGeneratorFactory has a method like this (Note: I'm using official mappings):

default DimensionGeneratorSettings createSettings(DynamicRegistries dynamicRegistries, long seed, boolean generateStructures, boolean bonusChest, String generatorSettings) {
    Registry<Biome> biomeRegistry = dynamicRegistries.registryOrThrow(Registry.BIOME_REGISTRY);
    Registry<DimensionType> dimensionTypeRegistry = dynamicRegistries.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
    Registry<DimensionSettings> dimensionSettingsRegistry = dynamicRegistries.registryOrThrow(Registry.NOISE_GENERATOR_SETTINGS_REGISTRY);
    return new DimensionGeneratorSettings(seed, generateStructures, bonusChest,
        DimensionGeneratorSettings.withOverworld(dimensionTypeRegistry,
            DimensionType.defaultDimensions(dimensionTypeRegistry, biomeRegistry, dimensionSettingsRegistry, seed),
            createChunkGenerator(biomeRegistry, dimensionSettingsRegistry, seed, generatorSettings)));
}

DimensionType.defaultDimensions actually handles the nether and end chunk generators. So, what I did was copy their entire method, which originally looks like this:

private static ChunkGenerator defaultEndGenerator(Registry < Biome > p_242717_0_, Registry < DimensionSettings > p_242717_1_, long p_242717_2_) {
    return new NoiseChunkGenerator(new EndBiomeProvider(p_242717_0_, p_242717_2_), p_242717_2_, () - > {
        return p_242717_1_.getOrThrow(DimensionSettings.END);
    });
}

private static ChunkGenerator defaultNetherGenerator(Registry < Biome > p_242720_0_, Registry < DimensionSettings > p_242720_1_, long p_242720_2_) {
    return new NoiseChunkGenerator(NetherBiomeProvider.Preset.NETHER.biomeSource(p_242720_0_, p_242720_2_), p_242720_2_, () - > {
        return p_242720_1_.getOrThrow(DimensionSettings.NETHER);
    });
}

public static SimpleRegistry < Dimension > defaultDimensions(Registry < DimensionType > p_242718_0_, Registry < Biome > p_242718_1_, Registry < DimensionSettings > p_242718_2_, long p_242718_3_) {
    SimpleRegistry < Dimension > simpleregistry = new SimpleRegistry < > (Registry.LEVEL_STEM_REGISTRY, Lifecycle.experimental());
    simpleregistry.register(Dimension.NETHER, new Dimension(() - > {
        return p_242718_0_.getOrThrow(NETHER_LOCATION);
    }, defaultNetherGenerator(p_242718_1_, p_242718_2_, p_242718_3_)), Lifecycle.stable());
    simpleregistry.register(Dimension.END, new Dimension(() - > {
        return p_242718_0_.getOrThrow(END_LOCATION);
    }, defaultEndGenerator(p_242718_1_, p_242718_2_, p_242718_3_)), Lifecycle.stable());
    return simpleregistry;
}

And changed 

simpleregistry.register(Dimension.NETHER, new Dimension(() - > {
    return p_242718_0_.getOrThrow(NETHER_LOCATION);
}, defaultNetherGenerator(p_242718_1_, p_242718_2_, p_242718_3_)), Lifecycle.stable());

into 

simpleregistry.register(Dimension.NETHER, new Dimension(() -> dimensionTypes.getOrThrow(DimensionType.NETHER_LOCATION), new SkyblockNetherChunkGenerator(NetherBiomeProvider.Preset.NETHER.biomeSource(biomeRegistry, seed), seed, () -> settings.getOrThrow(DimensionSettings.NETHER))), Lifecycle.stable());

Now I have full control about how the nether generates.

Link to comment
Share on other sites

  • NorthWestWind changed the title to [Solved] [1.16.5] Custom World Type Nether

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.