Jump to content

[1.7.10] Multiple Ore Generations problem


TheGoldCrayon

Recommended Posts

So I just started working on ore generation, and I have everything set up for my 5 custom ores. The only problem I seem to have lies within the "modGenerationWeight." I've tried setting them all to the same value, but only one of them will actually generate. I've also tried doing five different values, but the lowest value is the only one that spawns. Here's the code from my main file that registers the ore generations:

 

itemRoughOnyx = new ItemRoughOnyx().setUnlocalizedName("ItemRoughOnyx").setTextureName("gm:itemroughonyx").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemRoughOnyx, itemRoughOnyx.getUnlocalizedName().substring(5));
	itemSmoothOnyx = new ItemSmoothOnyx().setUnlocalizedName("ItemSmoothOnyx").setContainerItem(itemGemcuttersKnife).setTextureName("gm:itemsmoothonyx").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemSmoothOnyx, itemSmoothOnyx.getUnlocalizedName().substring(5));
	blockOnyxOre = new BlockOnyxOre(Material.rock).setBlockName("BlockOnyxOre").setBlockTextureName("gm:blockonyxore").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerBlock(blockOnyxOre, blockOnyxOre.getUnlocalizedName().substring(5));
	GameRegistry.registerWorldGenerator(new OnyxOreGeneration(), 4);

	itemRoughJade = new ItemRoughJade().setUnlocalizedName("ItemRoughJade").setTextureName("gm:itemroughjade").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemRoughJade, itemRoughJade.getUnlocalizedName().substring(5));
	itemSmoothJade = new ItemSmoothJade().setUnlocalizedName("ItemSmoothJade").setTextureName("gm:itemsmoothjade").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemSmoothJade, itemSmoothJade.getUnlocalizedName().substring(5));
	blockJadeOre = new BlockJadeOre(Material.rock).setBlockName("BlockJadeOre").setBlockTextureName("gm:blockjadeore").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerBlock(blockJadeOre, blockJadeOre.getUnlocalizedName().substring(5));
	GameRegistry.registerWorldGenerator(new JadeOreGeneration(), 3);

	itemRoughHowlite = new ItemRoughHowlite().setUnlocalizedName("ItemRoughHowlite").setTextureName("gm:itemroughhowlite").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemRoughHowlite, itemRoughHowlite.getUnlocalizedName().substring(5));
	itemSmoothHowlite = new ItemSmoothHowlite().setUnlocalizedName("ItemSmoothHowlite").setTextureName("gm:itemsmoothhowlite").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemSmoothHowlite, itemSmoothHowlite.getUnlocalizedName().substring(5));
	blockHowliteOre = new BlockHowliteOre(Material.rock).setBlockName("BlockHowliteOre").setBlockTextureName("gm:blockhowliteore").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerBlock(blockHowliteOre, blockHowliteOre.getUnlocalizedName().substring(5));
	GameRegistry.registerWorldGenerator(new HowliteOreGeneration(), 2);

	itemRoughSugilite = new ItemRoughSugilite().setUnlocalizedName("ItemRoughSugilite").setTextureName("gm:itemroughsugilite").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemRoughSugilite, itemRoughSugilite.getUnlocalizedName().substring(5));
	itemSmoothSugilite = new ItemSmoothSugilite().setUnlocalizedName("ItemSmoothSugilite").setTextureName("gm:itemsmoothsugilite").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemSmoothSugilite, itemSmoothSugilite.getUnlocalizedName().substring(5));
	blockSugiliteOre = new BlockSugiliteOre(Material.rock).setBlockName("BlockSugiliteOre").setBlockTextureName("gm:blocksugiliteore").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerBlock(blockSugiliteOre, blockSugiliteOre.getUnlocalizedName().substring(5));
	GameRegistry.registerWorldGenerator(new SugiliteOreGeneration(), 1);

	itemRoughChrysocolla = new ItemRoughChrysocolla().setUnlocalizedName("ItemRoughChrysocolla").setTextureName("gm:itemroughchrysocolla").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemRoughChrysocolla, itemRoughChrysocolla.getUnlocalizedName().substring(5));
	itemSmoothChrysocolla = new ItemSmoothChrysocolla().setUnlocalizedName("ItemSmoothChrysocolla").setTextureName("gm:itemsmoothchrysocolla").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerItem(itemSmoothChrysocolla, itemSmoothChrysocolla.getUnlocalizedName().substring(5));
	blockChrysocollaOre = new BlockChrysocollaOre(Material.rock).setBlockName("BlockChrysocollaOre").setBlockTextureName("gm:blockchrysocollaore").setCreativeTab(tabTheGoldCrayonsGemstonesMod);
	GameRegistry.registerBlock(blockChrysocollaOre, blockChrysocollaOre.getUnlocalizedName().substring(5));
	GameRegistry.registerWorldGenerator(new ChrysocollaOreGeneration(), 5);

 

 

And this is the code from one of the Ore's generation class. All 5 are exactly alike except for changes to the names because they're different ores:

 

package thegoldcrayon.thegoldcrayonsgemstonesmod;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
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 OnyxOreGeneration implements IWorldGenerator {

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
	switch(world.provider.dimensionId)
	{
	case 0:
		generateOverWorld(world, random, chunkX, chunkZ);
		break;
	}
}
public void generateOverWorld(World world, Random rand, int x, int z){
	generateOre(TheGoldCrayonsGemstonesMod.blockOnyxOre, world, rand, x, z, 2, 8, 15, 20, 50, Blocks.stone);
}

public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVeinSize, int maxVeinSize, int chance, int minY, int maxY, Block generateIn){
	int veinSize = minVeinSize + random.nextInt(maxVeinSize - minVeinSize);
	int heightRange = maxY - minY;
	WorldGenMinable gen = new WorldGenMinable(block, veinSize, generateIn);
	for(int i = 0; i < chance; i++){
		int xRand = chunkX * 16 + random.nextInt(16);
		int yRand = random.nextInt(heightRange) + minY;
		int zRand = chunkZ * 16 + random.nextInt(16);
		gen.generate(world, random, xRand, yRand, zRand);
	}
}



}

 

"War doesn't determine who is right. Only who is left." -Bertrand Russell

Link to comment
Share on other sites

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.