mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-17 19:05:02 +00:00
Fixed the Dynamic Mace so that it looks at the material of the block as well.
This commit is contained in:
1 parent
b2c013e8c6
commit
79f86a3a37
3 files changed
+44
-15
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user