Facebook
From zBrezzly_, 1 Week ago, written in Java.
Embed
Download Paste or View Raw
Hits: 26
  1. public class Board implements Listener {
  2.          
  3.     public static int i;
  4.     public static String ping;
  5.          
  6.  
  7.     public static Team getTeamForPlayer(Scoreboard board2, Player forWhom)
  8.     {
  9.        
  10.      if(forWhom.hasPermission("skypvp.inhaber")) {
  11.          return board2.getTeam("a");
  12.      }
  13.      if(forWhom.hasPermission("skypvp.admin")) {
  14.          return board2.getTeam("b");
  15.      }
  16.      if(forWhom.hasPermission("skypvp.developer") ) {
  17.          return board2.getTeam("c");
  18.      }
  19.      if(forWhom.hasPermission("skypvp.srmoderator")) {
  20.          return board2.getTeam("d");
  21.      }
  22.      if(forWhom.hasPermission("skypvp.moderator"))
  23.          return board2.getTeam("e");
  24.    
  25.      if(forWhom.hasPermission("skypvp.supporter")) {
  26.          return board2.getTeam("f");
  27.      }
  28.     if(forWhom.hasPermission("skypvp.builder")) {
  29.          return board2.getTeam("g");
  30.      }
  31.     if(forWhom.hasPermission("skypvp.azubi")) {
  32.          return board2.getTeam("h");
  33.     }
  34.     if(forWhom.hasPermission("skypvp.freund")) {
  35.          return board2.getTeam("i");
  36.     }
  37.     if(forWhom.hasPermission("skypvp.yt")) {
  38.         return board2.getTeam("j");
  39.     }
  40.     if(forWhom.hasPermission("skypvp.jryt")) {
  41.          return board2.getTeam("k");
  42.     }
  43.     if(forWhom.hasPermission("skypvp.lemon")) {
  44.          return board2.getTeam("l");    
  45.     }
  46.     if(forWhom.hasPermission("skypvp.supreme")) {
  47.          return board2.getTeam("m");
  48.     }
  49.     if(forWhom.hasPermission("skypvp.hero")) {
  50.          return board2.getTeam("n");
  51.     }
  52.     if(forWhom.hasPermission("skypvp.ultra")) {
  53.          return board2.getTeam("o");
  54.     }
  55.     if(forWhom.hasPermission("skypvp.premium")) {
  56.          return board2.getTeam("p");
  57.     }
  58.  
  59.          return board2.getTeam("q");    
  60.        
  61.        
  62.          
  63.   }  
  64.  
  65.     public static Team searchTeamsForEntry(Player forWhom, String entry) {
  66.        
  67.        if (forWhom.getScoreboard() == null) {
  68.          setBoard(forWhom);
  69.       }
  70.        Scoreboard board = forWhom.getScoreboard();
  71.        for (Team team : board.getTeams()) {
  72.          if (team.hasEntry(entry))
  73.            return team;
  74.       }
  75.        return null;
  76.     }
  77.    
  78.  
  79.     public static void setBoard(Player p)
  80.     {
  81.  
  82.        
  83.     Scoreboard board2 = Bukkit.getScoreboardManager().getNewScoreboard();
  84.    
  85.    
  86.       Team Inhaber = board2.registerNewTeam("a");
  87.       Team Admin = board2.registerNewTeam("b");
  88.       Team Dev = board2.registerNewTeam("c");
  89.       Team SrMod = board2.registerNewTeam("d");
  90.       Team Mod = board2.registerNewTeam("e");
  91.       Team Sup = board2.registerNewTeam("f");
  92.       Team Build = board2.registerNewTeam("g");
  93.       Team Azubi = board2.registerNewTeam("h");
  94.       Team Freund = board2.registerNewTeam("i");
  95.       Team YT = board2.registerNewTeam("j");
  96.       Team JrYT = board2.registerNewTeam("k");
  97.       Team Lemon = board2.registerNewTeam("l");
  98.       Team Supre = board2.registerNewTeam("m");
  99.       Team Hero = board2.registerNewTeam("n");
  100.       Team Ultra = board2.registerNewTeam("o");
  101.       Team Premi = board2.registerNewTeam("p");
  102.       Team Spieler = board2.registerNewTeam("q");
  103.  
  104.      
  105.      
  106.      
  107.      
  108.      
  109.       Inhaber.setPrefix("§4Inhaber §8● ");
  110.       Admin.setPrefix("§4Admin §8● ");
  111.       Dev.setPrefix("§bDev §8● ");
  112.       SrMod.setPrefix("§cSrMod §8● ");
  113.       Mod.setPrefix("§cMod §8● ");
  114.       Sup.setPrefix("§9Sup §8● ");
  115.       Build.setPrefix("§aBuilder §8● ");
  116.       Azubi.setPrefix("§dAzubi §8● ");
  117.       Freund.setPrefix("§eFreund §8● ");
  118.       YT.setPrefix("§5YT §8● ");
  119.       JrYT.setPrefix("§dJrYT §8● ");
  120.       Lemon.setPrefix("§eLemon §8● ");
  121.       Supre.setPrefix("§dSupr §8● ");
  122.       Hero.setPrefix("§2Hero §8● ");
  123.       Ultra.setPrefix("§bUltra §8● ");
  124.       Premi.setPrefix("§6Premi §8● ");
  125.       Spieler.setPrefix("§8Spieler §8● ");
  126.      
  127.      for (Player all : Bukkit.getOnlinePlayers()) {
  128.       Team playerTeam = getTeamForPlayer(board2, all);
  129.          if (!playerTeam.hasEntry(all.getName())) {
  130.           playerTeam.addEntry(all.getName());
  131.         }
  132.      }
  133.      for (Player all : Bukkit.getOnlinePlayers()) {
  134.          Team playerTeam = getTeamForPlayer(board2, all);
  135.             if (!playerTeam.hasEntry(all.getName())) {
  136.              playerTeam.addEntry(all.getName());
  137.            }
  138.          }
  139.      for (Player all : Bukkit.getOnlinePlayers()) {
  140.          Team playerTeam = getTeamForPlayer(board2, all);
  141.             if (!playerTeam.hasEntry(all.getName())) {
  142.              playerTeam.addEntry(all.getName());
  143.            }
  144.          }
  145.      for (Player all : Bukkit.getOnlinePlayers()) {
  146.          Team playerTeam = getTeamForPlayer(board2, all);
  147.             if (!playerTeam.hasEntry(all.getName())) {
  148.              playerTeam.addEntry(all.getName());
  149.            }
  150.          }
  151.      for (Player all : Bukkit.getOnlinePlayers()) {
  152.          Team playerTeam = getTeamForPlayer(board2, all);
  153.             if (!playerTeam.hasEntry(all.getName())) {
  154.              playerTeam.addEntry(all.getName());
  155.            }
  156.          }
  157.      Objective obj = board2.registerNewObjective("lobby", "system");
  158.  
  159.      if(p.hasPermission("skypvp.inhaber")) {
  160.         obj.getScore("§8➥ §4Inhaber").setScore(14);
  161.      }else if(p.hasPermission("skypvp.admin")) {
  162.         obj.getScore("§8➥ §4Admin").setScore(14);
  163.      }else if(p.hasPermission("skypvp.developer")) {
  164.         obj.getScore("§8➥ §bDeveloper").setScore(14);
  165.      }else if(p.hasPermission("skypvp.srmoderator")) {
  166.         obj.getScore("§8➥ §cSrModerator").setScore(14);
  167.      }else if(p.hasPermission("skypvp.moderator")) {
  168.         obj.getScore("§8➥ §cModerator").setScore(14);
  169.      }else if(p.hasPermission("skypvp.supporter")) {
  170.         obj.getScore("§8➥ §9Supporter").setScore(14);
  171.      }else if(p.hasPermission("skypvp.builder")) {
  172.         obj.getScore("§8➥ §aBuilder").setScore(14);
  173.      }else if(p.hasPermission("skypvp.azubi")) {
  174.          obj.getScore("§8➥ §eFreund").setScore(14);
  175.       }else if(p.hasPermission("skypvp.freund")) {
  176.         obj.getScore("§8➥ §eFreund").setScore(14);
  177.      }else if(p.hasPermission("skypvp.yt")) {
  178.         obj.getScore("§8➥ §5YT").setScore(14);
  179.      }else if(p.hasPermission("skypvp.jryt")) {
  180.          obj.getScore("§8➥ §dJrYT").setScore(14);
  181.      }else if(p.hasPermission("skypvp.lemon")) {
  182.          obj.getScore("§8➥ §eLemon").setScore(14);
  183.      }else if(p.hasPermission("skypvp.supreme")) {
  184.          obj.getScore("§8➥ §dSupreme").setScore(14);
  185.      }else if(p.hasPermission("skypvp.hero")) {
  186.          obj.getScore("§8➥ §2Hero").setScore(14);
  187.      }else if(p.hasPermission("skypvp.ultra")) {
  188.          obj.getScore("§8➥ §bUltra").setScore(14);
  189.      }else if(p.hasPermission("skypvp.premium")) {
  190.          obj.getScore("§8➥ §6Premium").setScore(14);
  191.      }else
  192.         obj.getScore("§8➥ §8Spieler").setScore(14);
  193.  
  194.  
  195.  
  196.  
  197.        
  198.         obj.setDisplaySlot(DisplaySlot.SIDEBAR);
  199.         obj.setDisplayName("§8▌ §bLemonMc§8.§bde§8 ▌");  
  200.  
  201.        
  202.         obj.getScore("§aDein Rang:").setScore(15);
  203.         obj.getScore("§6").setScore(13);
  204.         obj.getScore(" ").setScore(12);
  205.         obj.getScore("§aCoins:").setScore(11);
  206.         obj.getScore("§agagagga");
  207.         obj.getScore("§6").setScore(9);
  208.         obj.getScore("§aTeamSpeak:").setScore(8);
  209.         obj.getScore("§bLemonMc.de").setScore(7);
  210.         obj.getScore("§8").setScore(6);
  211.         obj.getScore("§aWebseite:").setScore(5);
  212.         obj.getScore("§bwww.LemonMc.de").setScore(4);
  213.         obj.getScore("§9").setScore(3);
  214.         obj.getScore("§aOnline:").setScore(2);
  215.         obj.getScore("§b" + Bukkit.getOnlinePlayers().size()+"§f/§b"+Bukkit.getMaxPlayers()).setScore(1);
  216.        
  217.         p.setScoreboard(board2);
  218.  
  219.    
  220.      
  221.  
  222.  
  223.  
  224.    
  225.     }
  226.    
  227. }
  228.