mcMMO/src/main/java/com/gmail/nossr50/runnables/skills/ToolLowerTask.java
GJ 339a54b0ac Replace SkillMonitorTask with 3 unique timers instead. This should greatly
optimize our tool and ability cooldown tracking and hopefully reduce
server load.
2013-04-29 15:33:55 -04:00

31 lines
831 B
Java

package com.gmail.nossr50.runnables.skills;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.ToolType;
public class ToolLowerTask extends BukkitRunnable {
private McMMOPlayer mcMMOPlayer;
private ToolType tool;
public ToolLowerTask(McMMOPlayer mcMMOPlayer, ToolType tool) {
this.mcMMOPlayer = mcMMOPlayer;
this.tool = tool;
}
@Override
public void run() {
if (!mcMMOPlayer.getToolPreparationMode(tool)) {
return;
}
mcMMOPlayer.setToolPreparationMode(tool, false);
if (Config.getInstance().getAbilityMessagesEnabled()) {
mcMMOPlayer.getPlayer().sendMessage(tool.getLowerTool());
}
}
}