Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void refreshLeaderbord() {
- db = SkyWars.getDB();
- Location hoofd1 = PluginConfig.getPlaceInConfig(Top3Type.HOOFD, 1);
- Location hoofd2 = PluginConfig.getPlaceInConfig(Top3Type.HOOFD, 2);
- Location hoofd3 = PluginConfig.getPlaceInConfig(Top3Type.HOOFD, 3);
- Location sign1 = PluginConfig.getPlaceInConfig(Top3Type.SIGN, 1);
- Location sign2 = PluginConfig.getPlaceInConfig(Top3Type.SIGN, 2);
- Location sign3 = PluginConfig.getPlaceInConfig(Top3Type.SIGN, 3);
- Map<String, Integer> wins = db.getTopWins(3);
- Block bh1 = hoofd1.getBlock();
- Block bh2 = hoofd1.getBlock();
- Block bh3 = hoofd1.getBlock();
- Block bs1 = sign1.getWorld().getBlockAt(sign1);
- Block bs2 = sign1.getWorld().getBlockAt(sign2);
- Block bs3 = sign1.getWorld().getBlockAt(sign3);
- if (bs1.getState() instanceof Sign && bs2.getState() instanceof Sign && bs3.getState() instanceof Sign) {
- Sign s1 = (Sign) bs1.getState();
- Sign s2 = (Sign) bs2.getState();
- Sign s3 = (Sign) bs3.getState();
- s1.setLine(0, centerText("======[1]======", 15));
- s1.setLine(1, centerText((String) wins.keySet().toArray()[0], 15));
- s1.setLine(2, centerText("Wins: " + wins.get((String) wins.keySet().toArray()[0]), 15));
- s1.setLine(3, centerText("======[1]======", 15));
- s2.setLine(0, "======[2]======");
- s2.setLine(1,(String) wins.keySet().toArray()[1]);
- s2.setLine(2, "Wins: " + wins.get((String) wins.keySet().toArray()[1]));
- s2.setLine(3, "======[2]======");
- s3.setLine(0, centerText("======[3]======", 15));
- s3.setLine(1, (String) wins.keySet().toArray()[2]);
- s3.setLine(2, "Wins: " + wins.get((String) wins.keySet().toArray()[2]));
- s3.setLine(3, "======[3]======");
- System.out.println("done all1");
- }
- if (bh1.getType() == Material.SKULL && bh2.getType() == Material.SKULL && bh3.getType() == Material.SKULL) {
- Skull h1 = (Skull) bh1.getState();
- Skull h2 = (Skull) bh2.getState();
- Skull h3 = (Skull) bh3.getState();
- h1.setSkullType(SkullType.PLAYER);
- h2.setSkullType(SkullType.PLAYER);
- h3.setSkullType(SkullType.PLAYER);
- h1.setOwner((String) wins.keySet().toArray()[1]);
- h2.setOwner((String) wins.keySet().toArray()[2]);
- h3.setOwner((String) wins.keySet().toArray()[3]);
- h1.update(true);
- h2.update(true);
- h3.update(true);
- System.out.println("done all2");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement