Jump to content

Recommended Posts

Posted

So I have lots of custom ores and I want each one to be mineable only with the previous tier of ore

For example, Orichulum can only be mined with Diamond, Mythril only with Orichulum, and so on.

 

But for some reason, every tool I make can mine every block I make, regardless of its harvest level.

What am I doing wrong?

 

ToolMaterials:

public static ToolMaterial ORICHULUM = EnumHelper.addToolMaterial("ORICHULUM", 4, 1800, 9F, 4F, 50);
public static ToolMaterial MYTHRIL = EnumHelper.addToolMaterial("MYTHRIL", 5, 2100, 10.0F, 6.0F, 12);
public static ToolMaterial ERIDIUM = EnumHelper.addToolMaterial("ERIDIUM", 6, 2800, 11.0F, 8.0F, 14);

 

Tools:

orichulumPick = new com.pixelmoncore.tools.nightmarePick(ORICHULUM).setCreativeTab(tabPixelmonCoreTools).setUnlocalizedName("orichulumPick").setTextureName("pixelmoncore:" + "orichulumPick");
mythrilPick = new com.pixelmoncore.tools.nightmarePick(MYTHRIL).setCreativeTab(tabPixelmonCoreTools).setUnlocalizedName("mythrilPick").setTextureName("pixelmoncore:" + "mythrilPick");

package com.pixelmoncore.tools;

import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;

public class orichulumPick extends ItemPickaxe
{
public orichulumPick(ToolMaterial material)
{
	super(material);
	this.setMaxStackSize(1);
}
    public void addInformation(ItemStack item, EntityPlayer player, List list, boolean par4)
    {
    	list.add("Can mine Mythril");     	
    }	

}

package com.pixelmoncore.tools;

import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;

public class mythrilPick extends ItemPickaxe
{
public mythrilPick(ToolMaterial material)
{
	super(material);
	this.setMaxStackSize(1);
}
    public void addInformation(ItemStack item, EntityPlayer player, List list, boolean par4)
    {
    	list.add("Can mine Eridium");     	
    }	

}

 

Blocks:

package com.pixelmoncore.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;


public class orichulumOre extends Block
{
public orichulumOre()
{
	super(Material.rock);
	this.setHardness(4F);
	this.setResistance(5F);
}
    public void setHarvestLevel(String toolClass, int level)
    {
        for (int m = 0; m < 16; m++)
        {
            setHarvestLevel("pickaxe", 3);
        }
    }
}

package com.pixelmoncore.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;


public class mythrilOre extends Block
{
public mythrilOre()
{
	super(Material.rock);
	this.setHardness(6F);
	this.setResistance(5F);
}
    public void setHarvestLevel(String toolClass, int level)
    {
        for (int m = 0; m < 16; m++)
        {
            setHarvestLevel("pickaxe", 4);
        }
    }
}

Posted

Ah, I thought that might be it, but I've been going off of tutorials that showed it the way I had it, so...

Got it working, thanks.

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.