Updating Tree Feller to use .getMaxDurability() API calls

This commit is contained in:
nossr50 2012-03-02 11:31:30 -08:00
parent 05cea84dcc
commit 0a97c1dc62
2 changed files with 1 additions and 17 deletions

View File

@ -449,22 +449,6 @@ public class Repair {
return false;
}
public static short getMaxDurability(ItemStack is)
{
if(isDiamondTools(is))
return (short) 1562;
else if(isIronTools(is))
return (short) 251;
else if(isGoldTools(is))
return (short) 33;
else if(isStoneTools(is))
return (short) 132;
else if(isWoodTools(is))
return (short) 66;
else
return 0;
}
public static boolean isBow(ItemStack is){
return is.getType() == Material.BOW;
}

View File

@ -73,7 +73,7 @@ public class WoodCutting
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability()+durabilityLoss));
//This is to prevent using wood axes everytime you tree fell
if(player.getItemInHand().getDurability() >= Repair.getMaxDurability(player.getItemInHand())
if((player.getItemInHand().getDurability() >= player.getItemInHand().getType().getMaxDurability())
|| player.getItemInHand().getType() == Material.AIR || player.getItemInHand() == null)
{
player.sendMessage(ChatColor.RED+"YOUR AXE SPLINTERS INTO DOZENS OF PIECES");