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

On my git i saw someone reporting a crash that happens only server sided:

java.lang.NoSuchMethodError: net.minecraft.world.biome.Biome.func_185359_l()Ljava/lang/String;

Is this maybe a clientside only method? The function is getBiomeName()

What should i use instead?

 

Edited by winnetrie

  • Author

I have changed it to this:

	public void generateOverworld(World world, Random rand, int x, int z){
		
		int XX = x * 16;
		int ZZ = z * 16;
		BlockPos pos = new BlockPos(XX, 70, ZZ);
		String biome = world.getBiome(pos).getRegistryName().toString().toLowerCase();
  
		System.out.println("Trying to generate in: "+ biome);
		if (ConfigHandler.enable_limestone_gen == true) {
			if (biome.contains("river")) {
				generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.limestone_gen_chance * 2, 45, 65, BlockMatcher.forBlock(Blocks.STONE));
			}
			if (biome.contains("ocean")) {
				generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 15, 33, ConfigHandler.limestone_gen_chance, 10, 50, BlockMatcher.forBlock(Blocks.STONE));
			}
		}
		if ((ConfigHandler.enable_marblestone_gen == true) && ((biome.contains("hills")) || (biome.contains("mountain")))) {
			generateOre(BlockInit.MARBLESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.marblestone_gen_chance, 65, 256, BlockMatcher.forBlock(Blocks.STONE));
		}
	}

Maybe not the best way. because the var biome contains also the mod id or in this case it has "minecraft:biomename"

Edited by winnetrie

  • Author

I hope i'm doing this right. I changed the code and tested it. Everything is working fine. I even have a feeling it's working better (more accurately).

	public void generateOverworld(World world, Random rand, int x, int z){
		
		int XX = x * 16;
		int ZZ = z * 16;
		BlockPos pos = new BlockPos(XX, 70, ZZ);
		Biome biome = world.getBiome(pos);
		
		if (ConfigHandler.enable_limestone_gen == true) {
			if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER)) {
				generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.limestone_gen_chance * 2, 45, 65, BlockMatcher.forBlock(Blocks.STONE));
			}
			if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN)) {
				generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 15, 33, ConfigHandler.limestone_gen_chance, 10, 50, BlockMatcher.forBlock(Blocks.STONE));
			}
		}
		if ((ConfigHandler.enable_marblestone_gen == true) && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.HILLS)) || (BiomeDictionary.hasType(biome, BiomeDictionary.Type.MOUNTAIN))) {
			generateOre(BlockInit.MARBLESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.marblestone_gen_chance, 65, 256, BlockMatcher.forBlock(Blocks.STONE));
		}
	}

Please don't say this is wrong.....:-)

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...

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.