mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-04 05:25:28 +02:00
Replace SkillMonitorTask with 3 unique timers instead. This should greatly
optimize our tool and ability cooldown tracking and hopefully reduce server load.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user