Jump to content

Recommended Posts

Posted

I tried this in my generate method in my world generation class:

		case(0):		
			if(world.getBiome(new BlockPos(chunkX, 64, chunkZ + random.nextInt(16))).getClass().equals(MineralBiome.class)) {
				generateHuge(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
				break;
			}
			generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
			break;

And it worked until I made the biome have less weight, and it stopped generating. How can I have special generation so it works?

Posted
1 hour ago, EOT3000 said:

new BlockPos(chunkX, 64, chunkZ + random.nextInt(16))

First of all as the variable names suggest these are chunk positions, not block positions. You need to left-shift these by 4 to translate to block positions. Also what is up with this random.nextInt(16)? Why is it there? Why is it 16? Why is it Z only?

 

1 hour ago, EOT3000 said:

getClass().equals(MineralBiome.class)

You could just do a direct comparason of objects(world.getBiome(...) == YourBiomes.MINERAL_BIOME)

 

 

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.