mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Updating Tree Feller to use .getMaxDurability() API calls
This commit is contained in:
parent
05cea84dcc
commit
0a97c1dc62
@ -449,22 +449,6 @@ public class Repair {
|
|||||||
return false;
|
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){
|
public static boolean isBow(ItemStack is){
|
||||||
return is.getType() == Material.BOW;
|
return is.getType() == Material.BOW;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public class WoodCutting
|
|||||||
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability()+durabilityLoss));
|
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability()+durabilityLoss));
|
||||||
|
|
||||||
//This is to prevent using wood axes everytime you tree fell
|
//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.getItemInHand().getType() == Material.AIR || player.getItemInHand() == null)
|
||||||
{
|
{
|
||||||
player.sendMessage(ChatColor.RED+"YOUR AXE SPLINTERS INTO DOZENS OF PIECES");
|
player.sendMessage(ChatColor.RED+"YOUR AXE SPLINTERS INTO DOZENS OF PIECES");
|
||||||
|
Loading…
Reference in New Issue
Block a user