Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.2] blockID and itemID


SilentThief
 Share

Recommended Posts

Hey, I am having a few issues with my mod, can't figure out what to do about blockID and itemID, I have the following code:

 

package apex.blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class MagicOre extends Block {

public MagicOre(Material material) {
	super(material);

	setHardness(3.0F);
	setStepSound(soundTypeStone);
	setCreativeTab(CreativeTabs.tabBlock);
	setBlockTextureName("apex:magic_ore");
	setBlockName("magicOre");

}

public int idDropped(int par1, Random par2Random, int par3){
	int drop = par2Random.nextInt(7);
	if (drop == 0){
		return apex.ApexCore.whiteDust.itemID;
	}else if (drop == 1){
		return apex.ApexCore.blueDust.itemID;
	}else if (drop == 2){
		return apex.ApexCore.purpleDust.itemID;
	}else if (drop == 3){
		return apex.ApexCore.brownDust.itemID;
	}else if (drop == 4){
		return apex.ApexCore.magicDust.itemID;
	}else if (drop == 5){
		return apex.ApexCore.pinkDust.itemID;
	}else if (drop == 6){
		return apex.ApexCore.redDust.itemID;
	}else{
		return apex.ApexCore.yellowDustA.itemID;
	}
}
@SideOnly(Side.CLIENT)

protected boolean canSilkHarvest(){
	return true;
}

//Drops 3-8 XP Orbs on block break.
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 j1 = 0;
		j1 = MathHelper.getRandomIntegerInRange(world.rand, 3, ;

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

 

For my items I have itemID, and blockID, there are no more IDs, so what do I change them to? :/

Link to comment
Share on other sites

Reference your blocks and items as blocks and items, not as ids. Ids no longer exist in 1.7. Also, if you used override annotations you would realize that idDropped no longer exists and has been changed to this:

public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
    {

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.