Jump to content

[1.17.1] Custom Biome size using OverworldBiomeSource


JT_

Recommended Posts

Hi, first time poster. I would like to enable the creation of extra large vanilla biomes (larger than what Large Biomes produces). I have done some searching on this forum and elsewhere and could not really find any good leads on how to implement this. I did some code searching on my own and found the relevant line that needs to be changed in biome.OverworldBiomeSource.class. Unfortunately it appears the value is hardcoded so I am not sure the best way to change it. I thought the class could be overridden but it seems like one would need to go down the rabbit hole of overriding classes to make it work properly. I also thought that maybe I could use reflection to call the function in question but not sure how I would detect when to do that (I am new to reflection so not sure this is even possible).

Relevant code:

biome.OverworldBiomeSource.class

public OverworldBiomeSource(long p_48590_, boolean p_48591_, boolean p_48592_, Registry<Biome> p_48593_) {
      super(java.util.stream.Stream.concat(POSSIBLE_BIOMES.stream(), net.minecraftforge.common.BiomeManager.getAdditionalOverworldBiomes().stream()).map((p_48603_) -> {
         return () -> {
            return p_48593_.getOrThrow(p_48603_);
         };
      }));
      this.seed = p_48590_;
      this.legacyBiomeInitLayer = p_48591_;
      this.largeBiomes = p_48592_;
      this.biomes = p_48593_;
      this.noiseBiomeLayer = Layers.getDefaultLayer(p_48590_, p_48591_, p_48592_ ? 6 : 4, 4);
   }

   public BiomeSource withSeed(long p_48596_) {
      return new OverworldBiomeSource(p_48596_, this.legacyBiomeInitLayer, this.largeBiomes, this.biomes);
   }

 

Layers.getDefaultLayer()

Spoiler

public static Layer getDefaultLayer(long p_76736_, boolean p_76737_, int p_76738_, int p_76739_) {
      int i = 25;
      AreaFactory<LazyArea> areafactory = getDefaultLayer(p_76737_, p_76738_, p_76739_, (p_76728_) -> {
         return new LazyAreaContext(25, p_76736_, p_76728_);
      });
      return new Layer(areafactory);
   }

and down the rabbit hole...

 

As can be seen the withSeed() function is called which passes in the largeBiomes boolean. In turn a ternary operator is used to decide if the Layers.getDefaultLayer function gets a 6 (Large Biomes) or a 4 (Default). I would like to pass in a different number here, say 10. Does anyone know a good way of doing this?

 

Thank you!

Link to comment
Share on other sites

16 hours ago, JT_ said:

In turn a ternary operator is used to decide if the Layers.getDefaultLayer function gets a 6 (Large Biomes) or a 4 (Default). I would like to pass in a different number here, say 10.

Yeah thanks I saw that, but since that property is a Boolean I can’t swap it for a different number. I want a value larger than the 6 hard coded in

Link to comment
Share on other sites

1 hour ago, JT_ said:

Yeah thanks I saw that, but since that property is a Boolean I can’t swap it for a different number. I want a value larger than the 6 hard coded in

 not possible without using coremods
You can ask questions about coremodding on the forge discord server in the non-api-modding chanel

Link to comment
Share on other sites

after thinking about your problem, here are two possible ideas they you could help you

you could create your own OverworldBiomeSource and register it with the Vanilla name
or
you could create your own OverworldBiomeSource and edit the overworld dimension file


The first option is the simpler one, but I'm not sure whether it works
the second option works but is complicated because you have to overwrite the dimension file for overworld and I don't know where the vanilla default file is

Edited by Luis_ST
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.

Announcements



×
×
  • Create New...

Important Information

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