Advertisement
Guest User

Untitled

a guest
Jan 1st, 2015
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.03 KB | None | 0 0
  1. Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, new Runnable(){
  2.  
  3.                                 public void run() {
  4.  
  5.                                     if(!p1.isEmpty() && !p2.isEmpty()){
  6.  
  7.                                         if(number == 11){
  8.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  9.                                                 if(p1.contains(online.getName())) {
  10.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 5");
  11.                                                 }
  12.  
  13.                                                 if(p2.contains(online.getName())) {
  14.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 5");
  15.                                                 }
  16.                                             }
  17.                                             number--;
  18.                                         }else if(number == 10){
  19.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  20.                                                 if(p1.contains(online.getName())) {
  21.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 4");
  22.                                                 }
  23.  
  24.                                                 if(p2.contains(online.getName())) {
  25.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 4");
  26.                                                 }
  27.                                             }
  28.                                             number--;
  29.                                         }else if(number == 9){
  30.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  31.                                                 if(p1.contains(online.getName())) {
  32.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 3");
  33.                                                 }
  34.  
  35.                                                 if(p2.contains(online.getName())) {
  36.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 3");
  37.                                                 }
  38.                                             }
  39.                                             number--;
  40.                                         }else if(number == 8){
  41.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  42.                                                 if(p1.contains(online.getName())) {
  43.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 2");
  44.                                                 }
  45.  
  46.                                                 if(p2.contains(online.getName())) {
  47.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 2");
  48.                                                 }
  49.                                             }
  50.                                             number--;
  51.                                         }else if(number == 7){
  52.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  53.                                                 if(p1.contains(online.getName())) {
  54.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 1");
  55.                                                 }
  56.  
  57.                                                 if(p2.contains(online.getName())) {
  58.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 1");
  59.                                                 }
  60.                                             }
  61.                                             number--;
  62.                                         }else if(number == 6){
  63.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  64.                                                 if(p1.contains(online.getName())) {
  65.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting To Arena");
  66.                                                     int x = yamlFile.getInt("pos1.x");
  67.                                                     int y = yamlFile.getInt("pos1.y");
  68.                                                     int z = yamlFile.getInt("pos1.z");
  69.                                                     int yaw = yamlFile.getInt("pos1.yaw");
  70.                                                     int pitch = yamlFile.getInt("pos1.pitch");
  71.                                                     Location loc1 = new Location(world, x + 0.5, y, z + 0.5, yaw, pitch);
  72.                                                     online.teleport(loc1);
  73.                                                     m.add(online.getName());
  74.  
  75.                                                     online.getInventory().clear();
  76.                                                     ItemStack potato = new ItemStack(Material.BAKED_POTATO);
  77.                                                     ItemMeta potatoMeta = potato.getItemMeta();
  78.                                                     potatoMeta.setDisplayName(GOLD+""+BOLD+"Potato Smash");
  79.                                                     potatoMeta.addEnchant(Enchantment.KNOCKBACK, 6, true);
  80.                                                     potato.setItemMeta(potatoMeta);
  81.  
  82.                                                     online.getInventory().addItem(potato);
  83.                                                 }
  84.  
  85.                                                 if(p2.contains(online.getName())) {
  86.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting To Arena");
  87.                                                     int x = yamlFile.getInt("pos2.x");
  88.                                                     int y = yamlFile.getInt("pos2.y");
  89.                                                     int z = yamlFile.getInt("pos2.z");
  90.                                                     int yaw = yamlFile.getInt("pos2.yaw");
  91.                                                     int pitch = yamlFile.getInt("pos2.pitch");
  92.                                                     Location loc2 = new Location(world, x + 0.5, y, z + 0.5, yaw, pitch);
  93.                                                     online.teleport(loc2);
  94.                                                     m.add(online.getName());
  95.  
  96.                                                     online.getInventory().clear();
  97.                                                     ItemStack potato = new ItemStack(Material.BAKED_POTATO);
  98.                                                     ItemMeta potatoMeta = potato.getItemMeta();
  99.                                                     potatoMeta.setDisplayName(GOLD+""+BOLD+"Potato Smash");
  100.                                                     potatoMeta.addEnchant(Enchantment.KNOCKBACK, 6, true);
  101.                                                     potato.setItemMeta(potatoMeta);
  102.  
  103.                                                     online.getInventory().addItem(potato);
  104.                                                 }
  105.                                             }
  106.                                             number--;
  107.                                         }else if(number == 5){
  108.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  109.                                                 if(p1.contains(online.getName())) {
  110.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 5");
  111.                                                 }
  112.  
  113.                                                 if(p2.contains(online.getName())) {
  114.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 5");
  115.                                                 }
  116.                                             }
  117.                                             number--;
  118.                                         }else if(number == 4){
  119.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  120.                                                 if(p1.contains(online.getName())) {
  121.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 4");
  122.                                                 }
  123.  
  124.                                                 if(p2.contains(online.getName())) {
  125.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 4");
  126.                                                 }
  127.                                             }
  128.                                             number--;
  129.                                         }else if(number == 3){
  130.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  131.                                                 if(p1.contains(online.getName())) {
  132.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 3");
  133.                                                 }
  134.  
  135.                                                 if(p2.contains(online.getName())) {
  136.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 3");
  137.                                                 }
  138.                                             }
  139.                                             number--;
  140.                                         }else if(number == 2){
  141.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  142.                                                 if(p1.contains(online.getName())) {
  143.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 2");
  144.                                                 }
  145.  
  146.                                                 if(p2.contains(online.getName())) {
  147.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 2");
  148.                                                 }
  149.                                             }
  150.                                             number--;
  151.                                         }else if(number == 1){
  152.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  153.                                                 if(p1.contains(online.getName())) {
  154.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 1");
  155.                                                     a1.add(online.getName());
  156.                                                 }
  157.  
  158.                                                 if(p2.contains(online.getName())) {
  159.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 1");
  160.                                                     a2.add(online.getName());
  161.                                                 }
  162.                                             }
  163.                                             number--;
  164.                                         }else if(number == 0){
  165.                                             for(Player online : Bukkit.getOnlinePlayers()) {
  166.                                                 if(p1.contains(online.getName())) {
  167.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GREEN+""+BOLD+" Time To Smash!");
  168.                                                     m.clear();
  169.                                                     p1.clear();
  170.                                                 }
  171.  
  172.                                                 if(p2.contains(online.getName())) {
  173.                                                     online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GREEN+""+BOLD+" Time To Smash!");
  174.                                                     m.clear();
  175.                                                     p2.clear();
  176.                                                 }
  177.                                             }
  178.                                             number--;
  179.                                         }
  180.                                         if(number == -1){
  181.  
  182.                                             Bukkit.getScheduler().cancelAllTasks();
  183.  
  184.                                             number = 11;
  185.                                         }
  186.  
  187.                                     }
  188.                                 }
  189.  
  190.                             }, 20, 20);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement