Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.30 KB | None | 0 0
  1. if (cooldown.containsKey(a) && cooldown.get(a) > System.currentTimeMillis()) {
  2.             long longRemaining = cooldown.get(a) - System.currentTimeMillis();
  3.             int intRemaining = (int) (longRemaining / 1000);
  4.  
  5.             a.sendMessage("§cYou must wait " + intRemaining + "s before using this command again!");
  6.         } else {
  7.             if (a.hasPermission("fe.bless")) {
  8.                 if (args.length == 0) {
  9.                     cooldown.put(a, System.currentTimeMillis() + (30 * 1000));
  10.                     String Message = ChatColor.translateAlternateColorCodes('&' , plugin.getConfig().getString("Bless.Message"));
  11.                     a.sendMessage(Message);
  12.  
  13.                     a.removePotionEffect(PotionEffectType.HARM);
  14.                     a.removePotionEffect(PotionEffectType.SLOW);
  15.                     a.removePotionEffect(PotionEffectType.SLOW_DIGGING);
  16.                     a.removePotionEffect(PotionEffectType.POISON);
  17.                     a.removePotionEffect(PotionEffectType.BLINDNESS);
  18.                     a.removePotionEffect(PotionEffectType.CONFUSION);
  19.  
  20.                     return true;
  21.                 }
  22.                 if (args.length == 1) {
  23.                     Player t = Bukkit.getPlayer(args[0]);
  24.                     if (t == null) {
  25.                         String invalid = ChatColor.translateAlternateColorCodes('&' , plugin.getConfig().getString("Bless.InvalidPlayer"));
  26.                         p.sendMessage(invalid);
  27.                         return true;
  28.                     }
  29.                     String cd = plugin.getConfig().getString("Bless.Cooldown");
  30.                     cooldown.put(a, System.currentTimeMillis() + (30 * 1000));
  31.                     a.sendMessage("§2You have used your Bless on " + t.getName());
  32.  
  33.                     t.removePotionEffect(PotionEffectType.HARM);
  34.                     t.removePotionEffect(PotionEffectType.SLOW);
  35.                     t.removePotionEffect(PotionEffectType.SLOW_DIGGING);
  36.                     t.removePotionEffect(PotionEffectType.POISON);
  37.                     t.removePotionEffect(PotionEffectType.BLINDNESS);
  38.                     t.removePotionEffect(PotionEffectType.CONFUSION);
  39.  
  40.                     t.sendMessage("§2" + a.getName() + " has used their bless on you!");
  41.                     return true;
  42.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement