Jump to content

[1.18.2] place Top-Blocks


TheidenHD

Recommended Posts

I am currently in the process of porting a mod to 1.18.2 an it contains a partially buried structure.

The Structure is supposed to contain some Top-Blocks(in plains grass, in the desert sand, on mushroom island mycelium).

In 1.16 I got the Top-Block of the Biome, but it looks like that isn't possible anymore.

@Override
protected void handleDataMarker(String function, BlockPos pos, ServerLevelAccessor worldIn, Random rand, BoundingBox boundingBox) {
	case "top_block":
		worldIn.setBlock(pos, genWorld.getBiome(pos).value().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(), Block.UPDATE_CLIENTS);
		break;
}

 

Link to comment
Share on other sites

It's not something I know a lot about.

This link tries to explain the change in 1.18: https://github.com/TheForsakenFurby/Surface-Rules-Guide-Minecraft-JE-1.18/blob/main/Guide.md

 

Here's the vanilla overworld config (for the latest 1.20 snapshot at time of writing):

https://github.com/misode/mcmeta/blob/9d422bf8fe4824657260721682e5527ef608ce67/data/minecraft/worldgen/noise_settings/overworld.json#LL386C2-L386C2

 

From what I understand, they are only available when the chunk generator uses the NoiseGenerationSettings and only to carvers.

So you shouldn't really rely on them being available. e.g. if somebody changes their overworld to "flat" you won't have any data.

 

The way mojang do this kind of thing is to have different structures based on the biome. e.g. see the different villages.

https://github.com/misode/mcmeta/tree/data/data/minecraft/structures/village

 

If you still want to try to figue out how to get hold of the data, I would start with

NoisedBasedChunkGenerator.topMaterial()

but notice that method is deprecated in 1.18.2 and doesn't exist in 1.19.4 (the CarvingContext and SurfaceSystem methods still exist but are also deprecated).

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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