From 8ad4e20cab3c033cf65765886952f009cdd56f4b Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 27 Feb 2012 20:40:25 -0500 Subject: [PATCH] Fixed leaving out a logical check for new skill processing. (Oops.) --- .../java/com/gmail/nossr50/skills/Skills.java | 19 +++++---- .../com/gmail/nossr50/skills/WoodCutting.java | 40 ------------------- 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/Skills.java b/src/main/java/com/gmail/nossr50/skills/Skills.java index a9b2cf32a..e56b0382f 100644 --- a/src/main/java/com/gmail/nossr50/skills/Skills.java +++ b/src/main/java/com/gmail/nossr50/skills/Skills.java @@ -80,15 +80,18 @@ public class Skills if(ability.getPermissions(player) && tool.inHand(player.getItemInHand()) && !tool.getToolMode(PP)) { - player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()) + "s)"); - return; + if(!ability.getMode(PP) && !cooldownOver(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown())) + { + player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()) + "s)"); + return; + } + + if(LoadProperties.enableAbilityMessages) + player.sendMessage(tool.getRaiseTool()); + + tool.setToolATS(PP, System.currentTimeMillis()); + tool.setToolMode(PP, true); } - - if(LoadProperties.enableAbilityMessages) - player.sendMessage(tool.getRaiseTool()); - - tool.setToolATS(PP, System.currentTimeMillis()); - tool.setToolMode(PP, true); } public static void monitorSkill(Player player, PlayerProfile PP, long curTime, SkillType skill){ diff --git a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java index 071875a41..fec760332 100644 --- a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java @@ -17,7 +17,6 @@ package com.gmail.nossr50.skills; import java.util.ArrayList; -import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; @@ -30,7 +29,6 @@ import org.bukkit.Bukkit; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.mcLocale; @@ -229,44 +227,6 @@ public class WoodCutting } } - public static void treeFellerCheck(Player player) - { - PlayerProfile PP = Users.getProfile(player); - if(m.isAxes(player.getItemInHand())) - { - /* - * CHECK FOR AXE PREP MODE - */ - if(PP.getAxePreparationMode()) - PP.setAxePreparationMode(false); - - int ticks = 2; - int x = PP.getSkillLevel(SkillType.WOODCUTTING); - - while(x >= 50) - { - x-=50; - ticks++; - } - - if(!PP.getTreeFellerMode() && Skills.cooldownOver(player, (PP.getSkillDATS(AbilityType.TREE_FELLER)*1000), LoadProperties.treeFellerCooldown)) - { - player.sendMessage(mcLocale.getString("Skills.TreeFellerOn")); - for(Player y : player.getWorld().getPlayers()) - { - if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(mcLocale.getString("Skills.TreeFellerPlayer", new Object[] {player.getName()})); - } - PP.setSkillDATS(AbilityType.TREE_FELLER, System.currentTimeMillis()+(ticks*1000)); - PP.setTreeFellerMode(true); - } - if(!PP.getTreeFellerMode() && !Skills.cooldownOver(player, (PP.getSkillDATS(AbilityType.TREE_FELLER)*1000), LoadProperties.treeFellerCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." - +ChatColor.YELLOW+" ("+Skills.calculateTimeLeft(player, (PP.getSkillDATS(AbilityType.TREE_FELLER)*1000), LoadProperties.treeFellerCooldown)+"s)"); - } - } - } - public static void woodcuttingBlockCheck(Player player, Block block, mcMMO plugin) { PlayerProfile PP = Users.getProfile(player);