mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Tree Feller damages the tool (again)
This commit is contained in:
parent
472bfa51da
commit
cb4b5d1c71
@ -60,6 +60,8 @@ public class WoodCutting
|
||||
|
||||
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile PP, mcMMO plugin)
|
||||
{
|
||||
int durabilityLoss = 0;
|
||||
|
||||
for(Block x : toBeFelled)
|
||||
{
|
||||
//Stupid NoCheat compatibility stuff
|
||||
@ -70,6 +72,8 @@ public class WoodCutting
|
||||
{
|
||||
if(x.getType() == Material.LOG || x.getType() == Material.LEAVES)
|
||||
{
|
||||
durabilityLoss++; //Damage the tool more if the Tree is larger
|
||||
|
||||
if(x.getType() == Material.LOG)
|
||||
{
|
||||
byte type = x.getData();
|
||||
@ -119,6 +123,17 @@ public class WoodCutting
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
{
|
||||
short durability = player.getItemInHand().getDurability();
|
||||
durability += (LoadProperties.abilityDurabilityLoss * durabilityLoss);
|
||||
player.getItemInHand().setDurability(durability);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private static boolean treeFellerCompatible(Block block)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user