[1.2.3]making new tool types (example paxel)
Page 1 of 1
[1.2.3]making new tool types (example paxel)
first of start by coping one of the "ItemSpade, ItemAxe or ItemPickaxe"
now you should have a file like this one
now you should have a file like this one
- Code:
package net.minecraft.src;
public class ItemAxe extends ItemTool
{
private static Block blocksEffectiveAgainst[];
protected ItemAxe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst);
}
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block != null && par2Block.blockMaterial == Material.wood)
{
return efficiencyOnProperMaterial;
}
else
{
return super.getStrVsBlock(par1ItemStack, par2Block);
}
}
static
{
blocksEffectiveAgainst = (new Block[]
{
Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stairDouble, Block.stairSingle, Block.pumpkin, Block.pumpkinLantern
});
}
}
- Code:
blocksEffectiveAgainst = (new Block[]
{
Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stairDouble, Block.stairSingle, Block.pumpkin, Block.pumpkinLantern
});
- Code:
public boolean canHarvestBlock(Block par1Block)
{
if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 2;
}
}
- Code:
protected ItemAxe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst);
}
pv9avenger- Member
- Posts : 8
Join date : 2012-01-31
Age : 25
Location : Iceland
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum