mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed leaving out a logical check for new skill processing. (Oops.)
This commit is contained in:
parent
1511c5737b
commit
8ad4e20cab
@ -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){
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user