Fixed leaving out a logical check for new skill processing. (Oops.)

This commit is contained in:
GJ 2012-02-27 20:40:25 -05:00
parent 1511c5737b
commit 8ad4e20cab
2 changed files with 11 additions and 48 deletions

View File

@ -80,15 +80,18 @@ public class Skills
if(ability.getPermissions(player) && tool.inHand(player.getItemInHand()) && !tool.getToolMode(PP)) 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)"); if(!ability.getMode(PP) && !cooldownOver(player, (PP.getSkillDATS(ability) * 1000), ability.getCooldown()))
return; {
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){ public static void monitorSkill(Player player, PlayerProfile PP, long curTime, SkillType skill){

View File

@ -17,7 +17,6 @@
package com.gmail.nossr50.skills; package com.gmail.nossr50.skills;
import java.util.ArrayList; import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -30,7 +29,6 @@ import org.bukkit.Bukkit;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.m; import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale; 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) public static void woodcuttingBlockCheck(Player player, Block block, mcMMO plugin)
{ {
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);