mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Changed Woodcutting durability calulations to ignore leaves and include
abilityDurabiltyLoss
This commit is contained in:
		@@ -58,7 +58,7 @@ public class WoodCutting {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int durabilityLoss = toBeFelled.size();
 | 
					        int durabilityLoss = durabilityLossCalulate(toBeFelled);
 | 
				
			||||||
        int xp = 0;
 | 
					        int xp = 0;
 | 
				
			||||||
        ItemStack inHand = player.getItemInHand();
 | 
					        ItemStack inHand = player.getItemInHand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -213,8 +213,10 @@ public class WoodCutting {
 | 
				
			|||||||
            if (!isTooAggressive(currentBlock, zNegative) && treeFellerCompatible(zNegative) && !toBeFelled.contains(zNegative)) {
 | 
					            if (!isTooAggressive(currentBlock, zNegative) && treeFellerCompatible(zNegative) && !toBeFelled.contains(zNegative)) {
 | 
				
			||||||
                processTreeFelling(zNegative, toBeFelled);
 | 
					                processTreeFelling(zNegative, toBeFelled);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (treeFellerCompatible(yPositive) && !toBeFelled.contains(yPositive)) {
 | 
					        if (treeFellerCompatible(yPositive)) {
 | 
				
			||||||
 | 
					            if(!currentBlock.hasMetadata("mcmmoPlacedBlock") && !toBeFelled.contains(yPositive)) {
 | 
				
			||||||
                processTreeFelling(yPositive, toBeFelled);
 | 
					                processTreeFelling(yPositive, toBeFelled);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -317,4 +319,16 @@ public class WoodCutting {
 | 
				
			|||||||
            SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
 | 
					            SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private static int durabilityLossCalulate(ArrayList<Block> toBeFelled) {
 | 
				
			||||||
 | 
					        int durabilityLoss = 0;
 | 
				
			||||||
 | 
					        for (Block x : toBeFelled) {
 | 
				
			||||||
 | 
					            if (x.getType().equals(Material.LOG)) {
 | 
				
			||||||
 | 
					                durabilityLoss++;
 | 
				
			||||||
 | 
					                durabilityLoss = durabilityLoss + LoadProperties.abilityDurabilityLoss;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return durabilityLoss;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,10 +126,11 @@ Abilities:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  Settings for Skills
 | 
					#  Settings for Skills
 | 
				
			||||||
 | 
					#  Level cap of 0 for no limit
 | 
				
			||||||
###
 | 
					###
 | 
				
			||||||
Skills:
 | 
					Skills:
 | 
				
			||||||
    Acrobatics:
 | 
					    Acrobatics:
 | 
				
			||||||
        Level_Cap: 0    #Level cap of 0 for no limit
 | 
					        Level_Cap: 0 
 | 
				
			||||||
    Archery:
 | 
					    Archery:
 | 
				
			||||||
        Level_Cap: 0
 | 
					        Level_Cap: 0
 | 
				
			||||||
    Axes:
 | 
					    Axes:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user