Advertisement
Soulseller

CollectItem Method Missing

Oct 25th, 2020
3,100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1. private void missing(CommandSender sender, String[] args)
  2.     {
  3.         if (!(sender instanceof Player))
  4.         {
  5.             sender.sendMessage(pl.PREFIX + "This is a player only command!");
  6.         }
  7.         else
  8.         {
  9.  
  10.             if (PermissionManager.canPerform(sender, "collector.mod"))
  11.             {
  12.                 String uuid;
  13.                 Player p = (Player) sender;
  14.  
  15.                 Player otherp = null;
  16.  
  17.                 if (args.length == 2)
  18.                 {
  19.                     if (Bukkit.getPlayer(args[1]) == null)
  20.                     {
  21.                         sender.sendMessage(pl.PREFIX + "Zu wenig Argumente");
  22.                     }
  23.                     otherp = Bukkit.getPlayer(args[1]);
  24.                     uuid = otherp.getUniqueId().toString();
  25.                 }
  26.                 else
  27.                 {
  28.                     otherp = p;
  29.                     uuid = p.getUniqueId().toString();
  30.                        
  31.                 }
  32.  
  33.                 if (Main.mode == Vismode.time)
  34.                 {
  35.                     sender.sendMessage(pl.PREFIX + "Nicht im Time Modus ausführbar");
  36.                 }
  37.                 else
  38.                 {
  39.                     if (otherp.isOnline())
  40.                     {
  41.                         LinkedList<String> missingItemslist = new LinkedList<String>();
  42.  
  43.                         missingItemslist = pl.getMissing(uuid);
  44.  
  45.                         sendMessage(p, pl.PREFIX + ChatColor.WHITE + otherp.getName() + ChatColor.GOLD
  46.                                 + " hat folgende Items noch nicht gesammelt: ", ChatColor.GOLD);
  47.  
  48.                         for (int i = 0; i < missingItemslist.size(); i++)
  49.                         {
  50.                             sendMessage(p, pl.PREFIX + " - " + ChatColor.DARK_GRAY + missingItemslist.get(i),
  51.                                     ChatColor.GOLD);
  52.                         }
  53.                     }
  54.                     else
  55.                     {
  56.                         sender.sendMessage(pl.PREFIX +ChatColor.WHITE + otherp.getName() + ChatColor.RED +" ist nicht online");
  57.                     }
  58.                 }
  59.  
  60.             }
  61.  
  62.         }
  63.     }
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement