Jump to content

Nether and End ore generation not working [Solved - see end for solution]


Recommended Posts

Posted

Sorted out all of my blocks for the world section of my mod, and have managed to get them to generate successfully in the overworld, however the ores which i set to generate in the nether and end do not seem to be spawning anywhere (several extended searches and high spawn rates for testing yielded nothing).

not sure what i'm doing wrong so any help would be welcome.

 

World Generator class (only showing one ore form each method as there's a lot of them)

package mods.mtech.code.common;

import java.util.Random;

import mods.mtech.code.blocks.BlockOreNether;
import mods.mtech.code.blocks.BlockOreOverworld;
import mods.mtech.code.client.Config;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class OreGeneration implements IWorldGenerator
{

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
	switch(world.provider.dimensionId)
	{
	case -1:
		generateNether(random, chunkX*16, chunkZ*16, world, chunkGenerator, chunkProvider);
		break;
	case 1:
		generateEnd(random, chunkX*16, chunkZ*16, world, chunkGenerator, chunkProvider);
		break;
	case 0:
		generateOverworld(random, chunkX*16, chunkZ*16, world, chunkGenerator, chunkProvider);
		break;
	}
}

private void generateOverworld(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{

	System.out.println("generating overworld");
	if(Config.Blocks.aluminiumOreEnabled)
	{
		for (int i = 0; i < 10; i++)
		{
			(new WorldGenMinable(BlockOreOverworld.oreAluminium.blockID, 5)).generate(world, random,
					chunkX + random.nextInt(16), random.nextInt(32), chunkZ + random.nextInt(16));
		}
	}
}

private void generateNether(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
	System.out.println("generating nether");
	if(Config.Blocks.azuriteOreEnabled)
	{
		for (int i = 0; i < 30; i++)
		{
			(new WorldGenMinable(BlockOreNether.oreAzurite.blockID, 50, Block.netherrack.blockID)).generate(world, random,
					chunkX + random.nextInt(16), random.nextInt(256), chunkZ + random.nextInt(16));
		}
	}
}

private void generateEnd(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
	System.out.println("generating end");
	if(Config.Blocks.calciteOreEnabled)
	{
		for (int i = 0; i < 50; i++)
		{
			(new WorldGenMinable(BlockOreNether.oreCalciteEnd.blockID, 10, Block.whiteStone.blockID)).generate(world, random,
					chunkX + random.nextInt(16), random.nextInt(256), chunkZ + random.nextInt(16));
		}
	}
}
}

 

the debug printing shows the correct prints for each dimension, but there's still no ore. (other than in the overworld)

I've also tried this with adapted versions of the WorldGenMinable class (just replacing the block id it was replacing with the one i was trying to spawn it in), but the results were the same

 

Thanks in advance

Posted
Understand the classes you are using.

WorldGenMinable only replaces stone. No stone in nether or end, so your ore doesnt generate.

Please do some research before posting, this is a inacturate statement.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

i know what the classes are using, if you look in the code for WorldGenMinable there are 3 constructors, one which will only replace stone and two where you can specify a target block (at least that's my understanding of it looking through the class). in my code i've specified the target blocks as netherrack and whitestone (endstone) so which is where my confusion arises from.

 

your point was one of the first things i though of, hence to start with i tred with my own versions of the code for this replacing the Block.stone.blockID with the necessary ones, which still had no effect.

 

(new WorldGenMinable(BlockOreNether.oreCalciteEnd.blockID, 10, Block.whiteStone.blockID))

Posted

How very odd...

 

looking further through the class, and the paths for all the variables i was passing it the target which can be set using the other constructors seems to be rather redundant

 

the following line is called before the ore is added to the chunk, and in the declaration for the method none of the parameters are relay necessary other than the block as when it's called it just checks to see if the id == stone.blockID.

 

if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, k2, l2, i3, field_94523_c)))

 

field_94523_c is supposed to be the id of the target block, and the bit which seems odd is the block.isGenMineableReplaceable(...) method.

 

this all seems rather odd to me, as i can't find it overridden in netherrack or anything ???

 

this could explain the problem, please say if I've missed anything here with the code or what it's actually doing. I do have a fair amount of experience of java, but we all make mistakes so i could've missed something.

 

 

P.S. currently making custom class to test

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Sorry for the late response, but the game opened and I made a world but it's stuck at 0% Here's the latest.log https://mclo.gs/peEb1R8 I disabled The Factory Must Grow and soulsweapons
    • Hey everyone! Two of my friends downloaded this modpack and are having an issue with the blocks loading in correctly. Grass looks like bamboo, waystones look like two barrels stacked on eachother, and wheat looks like water and stairs. What is this problem? How can we fix it? Neither of my other friends or myself had this issue. 
    • I removed Yung's cave biome mod and It wasnt in one of those biomes however the log file said the same line (([25Apr2025 21:20:15.500] [Flywheel Task Executor #5/WARN] [Embeddium-MixinTaintDetector/]: Mod(s) [oculus] are modifying Embeddium class me.jellysquid.mods.sodium.client.render.vertex.serializers.VertexSerializerRegistryImpl, which may cause instability.))
    • Note: i had a couple of ideas, but i just don't know how to execute them. The main idea was to make the new block (let's exemplify with a mixer) be essentially a clone of the mechanical mixer (different texture tho) that would have a different recipe type (instead of mixing, advanced_mixing) and i would copy all the create mod recipes and edit the processing time while also adding the tier dependent ones.
    • Hi! Before everything, thank you for even reading. I'm coming here in need of help making a few aspects for a create mod addon. It's an addon that aims to add almost the full periodic table with realistic ways of obtaining all the elements and capability of almost full automation. For what purpose? A techy armor and to go to the moon and rocky planets of the solar system. It'll have 3 different tiers of machines (mixer, millstone, crushing wheels): basic (just the normal create mod machines but renamed), advanced (25% faster and has recipes only possible for this tier and above) end elite (75% faster than basic and recipes only available for this tier). The problem is, I'm not a coder. I know less than the basics. I know how to do everything else but these machine tiers and i need some help if you can.
  • Topics

×
×
  • Create New...

Important Information

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