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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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