Added CooldownHandler#getCooldown

This commit is contained in:
Joel 2021-02-21 19:00:57 +01:00
parent 01871a9b4b
commit 84e9a98778

View File

@ -63,7 +63,12 @@ public class CooldownHandler extends Module {
return true;
}
public static Cooldown getCooldown(Player player, String name) {
return getCooldowns(player).stream().filter(cooldown -> cooldown.getName().equals(name)).findFirst().orElse(null);
}
private static List<Cooldown> getCooldowns(Player player) {
return cooldowns.getOrDefault(player, new ArrayList<>());
}
}