Fixed the Dynamic Mace so that it looks at the material of the block as well.
This commit is contained in:
parent
b2c013e8c6
commit
79f86a3a37
3 changed files with 44 additions and 15 deletions
|
@ -285,7 +285,12 @@ public class ItemSpellMultiTool extends Item
|
|||
|
||||
if (toolClass == null || toolClass.equals(""))
|
||||
{
|
||||
return 1.0f;
|
||||
toolClass = getToolClassOfMaterial(block.getMaterial());
|
||||
|
||||
if(toolClass == "")
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (stack.hasTagCompound())
|
||||
|
@ -301,6 +306,26 @@ public class ItemSpellMultiTool extends Item
|
|||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public String getToolClassOfMaterial(Material mat)
|
||||
{
|
||||
if(mat == Material.iron || mat == Material.anvil || mat == Material.rock)
|
||||
{
|
||||
return "pickaxe";
|
||||
}
|
||||
|
||||
if(mat == Material.wood || mat == Material.plants || mat == Material.vine)
|
||||
{
|
||||
return "axe";
|
||||
}
|
||||
|
||||
if(mat == Material.ground || mat == Material.grass)
|
||||
{
|
||||
return "shovel";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue