Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (cooldown.containsKey(a) && cooldown.get(a) > System.currentTimeMillis()) {
- long longRemaining = cooldown.get(a) - System.currentTimeMillis();
- int intRemaining = (int) (longRemaining / 1000);
- a.sendMessage("§cYou must wait " + intRemaining + "s before using this command again!");
- } else {
- if (a.hasPermission("fe.bless")) {
- if (args.length == 0) {
- cooldown.put(a, System.currentTimeMillis() + (30 * 1000));
- String Message = ChatColor.translateAlternateColorCodes('&' , plugin.getConfig().getString("Bless.Message"));
- a.sendMessage(Message);
- a.removePotionEffect(PotionEffectType.HARM);
- a.removePotionEffect(PotionEffectType.SLOW);
- a.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- a.removePotionEffect(PotionEffectType.POISON);
- a.removePotionEffect(PotionEffectType.BLINDNESS);
- a.removePotionEffect(PotionEffectType.CONFUSION);
- return true;
- }
- if (args.length == 1) {
- Player t = Bukkit.getPlayer(args[0]);
- if (t == null) {
- String invalid = ChatColor.translateAlternateColorCodes('&' , plugin.getConfig().getString("Bless.InvalidPlayer"));
- p.sendMessage(invalid);
- return true;
- }
- String cd = plugin.getConfig().getString("Bless.Cooldown");
- cooldown.put(a, System.currentTimeMillis() + (30 * 1000));
- a.sendMessage("§2You have used your Bless on " + t.getName());
- t.removePotionEffect(PotionEffectType.HARM);
- t.removePotionEffect(PotionEffectType.SLOW);
- t.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- t.removePotionEffect(PotionEffectType.POISON);
- t.removePotionEffect(PotionEffectType.BLINDNESS);
- t.removePotionEffect(PotionEffectType.CONFUSION);
- t.sendMessage("§2" + a.getName() + " has used their bless on you!");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement