Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've tried several different things to get this to work, but I must be missing something incredibly simple because it just plain doesn't work.

 

Basically, I want to control whether or not an ore spawns in a specific biome. I've gotten the ore to spawn how I like it in every other way (height max, height min, vein size, etc) but whenever I try and base my spawning off of a biome it seems to just.. crap itself. Here's what I have so far.

 

 

BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);
...
	if(b.biomeName=="Plains")
	{
		System.out.println(b.biomeName);
		(new WorldGenMinable(Drore.oreCopper.blockID, 100)).generate(world, random, Xcoord, Ycoord, Zcoord);
	}

 

It seems to partially work. If I change the if to 'true', it works fine. If I remove the if and System.out entirely, it works fine. If I remove the if statement but leave the System.out it will print a lot of different biome names as it loads different chunks from different biomes. If I run it with that code above, it appears to work. It will print out "Plains" a shitload (and no other biomes) whenever I encounter a Plains biome, but the ores will not generate. It seems like it enters the if statement, but fails to execute the generation regardless.

 

I have also tried b.biomeName.equals("Plains") as well, to no avail.

 

tl;dr Someone explain how to generate ores differently based on biome because I clearly don't get it.

BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);

 

You have to use instead of chunkX and chunkZ, the Xcoord and Zcoord.

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.

  • Author

Damn, thanks. I knew it'd be something simple and dumb like that. Seems to have done the trick.

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.