Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.37 KB | None | 0 0
  1.     public void refreshLeaderbord() {
  2.         db = SkyWars.getDB();
  3.        
  4.         Location hoofd1 = PluginConfig.getPlaceInConfig(Top3Type.HOOFD, 1);
  5.         Location hoofd2 = PluginConfig.getPlaceInConfig(Top3Type.HOOFD, 2);
  6.         Location hoofd3 = PluginConfig.getPlaceInConfig(Top3Type.HOOFD, 3);
  7.        
  8.         Location sign1 = PluginConfig.getPlaceInConfig(Top3Type.SIGN, 1);
  9.         Location sign2 = PluginConfig.getPlaceInConfig(Top3Type.SIGN, 2);
  10.         Location sign3 = PluginConfig.getPlaceInConfig(Top3Type.SIGN, 3);
  11.        
  12.         Map<String, Integer> wins = db.getTopWins(3);
  13.        
  14.         Block bh1 = hoofd1.getBlock();
  15.         Block bh2 = hoofd1.getBlock();
  16.         Block bh3 = hoofd1.getBlock();
  17.        
  18.         Block bs1 = sign1.getWorld().getBlockAt(sign1);
  19.         Block bs2 = sign1.getWorld().getBlockAt(sign2);
  20.         Block bs3 = sign1.getWorld().getBlockAt(sign3);
  21.        
  22.         if (bs1.getState() instanceof Sign && bs2.getState() instanceof Sign && bs3.getState() instanceof Sign) {
  23.             Sign s1 = (Sign) bs1.getState();
  24.             Sign s2 = (Sign) bs2.getState();
  25.             Sign s3 = (Sign) bs3.getState();
  26.            
  27.             s1.setLine(0, centerText("======[1]======", 15));
  28.             s1.setLine(1, centerText((String) wins.keySet().toArray()[0], 15));
  29.             s1.setLine(2, centerText("Wins: " + wins.get((String) wins.keySet().toArray()[0]), 15));
  30.             s1.setLine(3, centerText("======[1]======", 15));
  31.            
  32.             s2.setLine(0, "======[2]======");
  33.             s2.setLine(1,(String) wins.keySet().toArray()[1]);
  34.             s2.setLine(2, "Wins: " + wins.get((String) wins.keySet().toArray()[1]));
  35.             s2.setLine(3, "======[2]======");
  36.            
  37.             s3.setLine(0, centerText("======[3]======", 15));
  38.             s3.setLine(1, (String) wins.keySet().toArray()[2]);
  39.             s3.setLine(2, "Wins: " + wins.get((String) wins.keySet().toArray()[2]));
  40.             s3.setLine(3, "======[3]======");
  41.             System.out.println("done all1");
  42.         }
  43.        
  44.         if (bh1.getType() == Material.SKULL && bh2.getType() == Material.SKULL && bh3.getType() == Material.SKULL) {
  45.             Skull h1 = (Skull) bh1.getState();
  46.             Skull h2 = (Skull) bh2.getState();
  47.             Skull h3 = (Skull) bh3.getState();
  48.            
  49.             h1.setSkullType(SkullType.PLAYER);
  50.             h2.setSkullType(SkullType.PLAYER);
  51.             h3.setSkullType(SkullType.PLAYER);
  52.  
  53.             h1.setOwner((String) wins.keySet().toArray()[1]);
  54.             h2.setOwner((String) wins.keySet().toArray()[2]);
  55.             h3.setOwner((String) wins.keySet().toArray()[3]);
  56.            
  57.             h1.update(true);
  58.             h2.update(true);
  59.             h3.update(true);
  60.             System.out.println("done all2");
  61.         }
  62.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement