Jump to content

Dropping meta data items


Fergoman007

Recommended Posts

hi im having trouble getting my ore to drop my items using meta data

 

BlockOreEmeraldCrystal class:

package fergoman007.mods.fergotools.block;

import java.util.Random;

import fergoman007.mods.fergotools.FergoTools;
import fergoman007.mods.fergotools.lib.Reference;
import fergoman007.mods.fergotools.lib.Strings;
import fergoman007.mods.fergotools.lib.Textures;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;

public class BlockOreEmeraldCrystal extends Block {

public BlockOreEmeraldCrystal(int par1, Material par2Material) {
	super(par1, par2Material);
	this.setUnlocalizedName(Strings.oreEmeraldCrystal);
	this.setHardness(2.5f);
	this.setStepSound(soundStoneFootstep);
	this.setResistance(50f);
	this.setCreativeTab(FergoTools.tabFergoBlocks);
}

public void registerIcons(IconRegister register)
{
	blockIcon = register.registerIcon(Reference.TEXTURE_LOC + Textures.oreEmeraldCrystalTexture);
}

public int damageDropped(int metadata)
{
	switch(metadata)
	{
	case 1: return FergoTools.fergoMaterials.itemID;
	}
	return metadata;
}

@Override
public int idDropped(int metadata, Random random, int par2)
{
	switch(metadata)
	{
	case 1 : return FergoTools.fergoMaterials.itemID;
	// Error Case
	default: return -1; // air
	}
}

public int quantityDropped(int par1, Random rand, int par2)
{
	return 3 + rand.nextInt(4) + 1;
}

public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
{
	this.dropXpOnBlockBreak(world, x, y, z, 4);
}

}

 

i would appreciate the help

 

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.