mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 09:13:43 +01:00 
			
		
		
		
	Cleaner way of doing the axe checks.
This commit is contained in:
		| @@ -102,22 +102,13 @@ public class Skills { | ||||
|         /* Woodcutting & Axes need to be treated differently. | ||||
|          * Basically the tool always needs to ready and we check to see if the cooldown is over when the user takes action | ||||
|          */ | ||||
|         if (skill == SkillType.WOODCUTTING || skill == SkillType.AXES) { | ||||
|             if ((mcPermissions.getInstance().treeFeller(player) || mcPermissions.getInstance().skullSplitter(player)) &&  | ||||
|                     tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) { | ||||
|                 if (LoadProperties.enableAbilityMessages) { | ||||
|                     player.sendMessage(tool.getRaiseTool()); | ||||
|                 } | ||||
|  | ||||
|                 PP.setToolPreparationATS(tool, System.currentTimeMillis()); | ||||
|                 PP.setToolPreparationMode(tool, true); | ||||
|             } | ||||
|         } | ||||
|         else if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) { | ||||
|         if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) { | ||||
|             if (skill != SkillType.WOODCUTTING && skill != SkillType.AXES) { | ||||
|                 if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) { | ||||
|                     player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)"); | ||||
|                     return; | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if (LoadProperties.enableAbilityMessages) { | ||||
|                 player.sendMessage(tool.getRaiseTool()); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 GJ
					GJ