Jump to content

Biome specific block generation. [Solved]


Kander16

Recommended Posts

Hi,

 

I have created a new block (salt) that should generate in specific biomes.

This works without problems.

 

But, I have another few blocks created that should do the same. Only, this does not work.

When I take the code out of the class file, that checks in what specific biomes it should generates, it generates like as normal.

Only without the specific biomes.

 

 

When I undo this, and take the code back, It just does not generate.

 

Code of the bush:

 

http://pastebin.com/BbBD1zrc

 

Code of my salt & stuff:

 

http://pastebin.com/MryBjXXW

 

Thanks for helping.

 

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Link to comment
Share on other sites

I'm not 100% sure but I'll throw out ideas to hopefully prompt some solution.

 

Inside your OreGeneration pastie you have:

 if (biome instanceof BiomeGenOcean || biome instanceof BiomeGenRiver || biome instanceof BiomeGenBeach)

 

I'm curious if you'd be better of comparing the biome there to be perfectly equal to a biome rather than an instance of it. I say this because I believe that world generation uses a single instance of each BiomeGenBase to generate the entire world.

public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans);

 

Maybe try to check if biome == BiomeGenBase.ocean?

Link to comment
Share on other sites

I'm not 100% sure but I'll throw out ideas to hopefully prompt some solution.

 

Inside your OreGeneration pastie you have:

 if (biome instanceof BiomeGenOcean || biome instanceof BiomeGenRiver || biome instanceof BiomeGenBeach)

 

I'm curious if you'd be better of comparing the biome there to be perfectly equal to a biome rather than an instance of it. I say this because I believe that world generation uses a single instance of each BiomeGenBase to generate the entire world.

public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans);

 

Maybe try to check if biome == BiomeGenBase.ocean?

 

Also

world.getBiomeGenForCoords(x, z)

should not get the chunkX and chunkZ coordinates. It needs the actual block coords!

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

O, now I see.

 

It was a bit of stupidness actually.

 

What I did was,

 

world.getBiomeGenForCoords(chunkX, chunkZ)

 

BUT, chunkX and chunkZ was never determined.

It just was int chunkX and int chunkZ.

But what number is chunkX, chunkZ actually? We don't know that.

 

So what i've changed:

 

world.getBiomeGenForCoords(xRand, zRand)

 

And since xRand, zRand is a chunk (

int xRand = chunkX * 16 + random.nextInt(16);

)

It now have the coordinates.

 

Thanks anyway.

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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