Added CooldownHandler#getCooldown
This commit is contained in:
parent
01871a9b4b
commit
84e9a98778
@ -63,7 +63,12 @@ public class CooldownHandler extends Module {
|
|||||||
return true;
|
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) {
|
private static List<Cooldown> getCooldowns(Player player) {
|
||||||
return cooldowns.getOrDefault(player, new ArrayList<>());
|
return cooldowns.getOrDefault(player, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user