How do i make custom liquid more rare

Started by SquidkingInc on Sun, 05/12/2019 - 19:23

Topic category: Advanced modding

Last seen on 00:03, 26. May 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How do i make custom liquid more rare
Sun, 05/12/2019 - 19:23

i made a custom liquid at set it to generate in the overworld but it spawns so frequently that world generation takes ages, how do i make it more rare

Last seen on 19:39, 25. May 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
This is not possible yet,…
Mon, 05/13/2019 - 15:39

This is not possible yet, but we have a ticket for this open on our issue tracker. Upvote it to get it resolved faster.

Last seen on 00:03, 26. May 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Can i do it with custom code…
Mon, 05/13/2019 - 18:16

Can i do it with custom code though?

 

Last seen on 19:39, 25. May 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
You could wrap generator…
Mon, 05/13/2019 - 18:57

You could wrap generator code with a condition such as if(Math.random() > 0.5) to reduce the generating frequency.

Last seen on 00:03, 26. May 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Can't find generator code  
Tue, 05/14/2019 - 18:41

Can't find generator code

 

Last seen on 19:39, 25. May 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
It is inside generateWorld…
Tue, 05/14/2019 - 19:10

It is inside generateWorld of your fluid.

Last seen on 00:03, 26. May 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How do i wrap it do i just…
Tue, 05/14/2019 - 22:01

How do i wrap it

do i just paste the code in there?

Last seen on 00:03, 26. May 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
where do i paste it :p  
Tue, 05/14/2019 - 22:02

where do i paste it :p

 

Last seen on 00:03, 26. May 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
@Override     public void…
Tue, 05/14/2019 - 22:05

@Override
    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
        int i = chunkX + random.nextInt(16) + 8;
        int j = random.nextInt(256);
        int k = chunkZ + random.nextInt(16) + 8;
        new WorldGenLakes(block).generate(world, random, new BlockPos(i, j, k));
    }
}

Last seen on 19:39, 25. May 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
If you don't know where to…
Wed, 05/15/2019 - 11:28

If you don't know where to paste this, you might want to learn some Java before trying this. But you should wrap the generated code with your if statement:

if(random.nextInt(100) > 50) {
    int i = chunkX + random.nextInt(16) + 8;
    int j = random.nextInt(256);
    int k = chunkZ + random.nextInt(16) + 8;
    new WorldGenLakes(block).generate(world, random, new BlockPos(i, j, k));
}

In my example, I use provided random generator so the probability is conditioned with the world seed.