Jump to content

[1.6.4]Fortune Doesn't Affect Custom Ore [*SOLVED*]


MetroidMan347

Recommended Posts

Hello.

 

So I've recently begun my second mod which I've named Jake's Gems which adds gems very similar to the ones in RedPower2. Yes, I'm aware this idea is not very original, but I wanted to make it both as a learning experience and something to complement a custom modpack of mine.

 

Anyway the problem I'm having is just like the title says. My custom ore is unaffected by being broken with a Fortune Pickaxe.

 

Here is the code in my RubiteOre class:

 

package jakegems;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class RubiteOre extends Block {

public RubiteOre(int id, Material material) {
	super (id, material);

	setHardness(1.5f);
	setStepSound(Block.soundStoneFootstep);
	setUnlocalizedName("newBlock");
	setCreativeTab(CreativeTabs.tabMisc);
}

public int idDropped (int metadata, Random random, int fortune) {
	return JakeGems.gemRubite.itemID;
}

public void dropBlockAsItemWithChance (World world, int par2, int par3, int par4, int par5, float par6, int par7) {

	super.dropBlockAsItemWithChance(world, par2, par3, par4, par5, par6, par7);

	if (this.idDropped(par5, world.rand, par7) != this.blockID) {

		int xporbs = 0;
		xporbs = MathHelper.getRandomIntegerInRange(world.rand, 0, 12);

		this.dropXpOnBlockBreak(world, par2, par3, par4, xporbs);
	}

}
}

 

Any and all help received is greatly appreciated, thank you!

 

Laterz,

~Jake

Link to comment
Share on other sites

  • 1 month later...

I believe this is the method you're looking for:

public int quantityDropped(int meta, int fortune, Random random)
    {
        return quantityDroppedWithBonus(fortune, random);
    }

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

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.