Jump to content

[1.16.3] Biome#getRegistryName always returns null


Recommended Posts

Posted (edited)

So, I've recently been trying to create a new chunk generator for my mod.

Because I want individual chunk generators per biome, and because the biome class itself can't be extended anymore,

I decided to create a hash map with a resource location as an input and a custom class(with the chunk gen) as an output.

 

The thing is, everytime I want to access this hash map with the resource location of the biome, it returns null.

After a quick debugging sessions it turns out that the method Biome#getRegistryName always returns null, even on vanilla and hardcoded biomes.

 

How can I solve/avoid this problem?

 

Help would be appreciated.

-Budschie

Edited by Budschie
Posted

So, here is my code:

 

Calling Biome#getRegistryName

Biome biome = worldGenRegion.getBiome(new BlockPos(posXStart + x, 0, posZStart + z));
BiomeGeneratorBase biomeGenerator = BiomeDataHandler.getBiomeData(biome.getRegistryName()).getBiomeGenerator();

 

Setup of the BiomeDataHandler:

BiomeDataHandler.addBiomeData(new ResourceLocation(References.MODID, "green_forest_biome"), new GreenForestBiomeData());
BiomeDataHandler.addBiomeData(new ResourceLocation(References.MODID, "deepnether"), new DeepnetherBiomeData());

 

Here is my GitHub-Repo: https://github.com/Budschie/Deepnether-Mod/tree/1.16.3

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.