mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Cleaner way of doing the axe checks.
This commit is contained in:
parent
9ef68d226a
commit
0c22064a94
@ -102,21 +102,12 @@ public class Skills {
|
|||||||
/* Woodcutting & Axes need to be treated differently.
|
/* 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
|
* 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 (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
||||||
if ((mcPermissions.getInstance().treeFeller(player) || mcPermissions.getInstance().skullSplitter(player)) &&
|
if (skill != SkillType.WOODCUTTING && skill != SkillType.AXES) {
|
||||||
tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
||||||
if (LoadProperties.enableAbilityMessages) {
|
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
||||||
player.sendMessage(tool.getRaiseTool());
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.setToolPreparationATS(tool, System.currentTimeMillis());
|
|
||||||
PP.setToolPreparationMode(tool, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
|
||||||
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) {
|
if (LoadProperties.enableAbilityMessages) {
|
||||||
|
Loading…
Reference in New Issue
Block a user