Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, new Runnable(){
- public void run() {
- if(!p1.isEmpty() && !p2.isEmpty()){
- if(number == 11){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 5");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 5");
- }
- }
- number--;
- }else if(number == 10){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 4");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 4");
- }
- }
- number--;
- }else if(number == 9){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 3");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 3");
- }
- }
- number--;
- }else if(number == 8){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 2");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 2");
- }
- }
- number--;
- }else if(number == 7){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 1");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting In 1");
- }
- }
- number--;
- }else if(number == 6){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting To Arena");
- int x = yamlFile.getInt("pos1.x");
- int y = yamlFile.getInt("pos1.y");
- int z = yamlFile.getInt("pos1.z");
- int yaw = yamlFile.getInt("pos1.yaw");
- int pitch = yamlFile.getInt("pos1.pitch");
- Location loc1 = new Location(world, x + 0.5, y, z + 0.5, yaw, pitch);
- online.teleport(loc1);
- m.add(online.getName());
- online.getInventory().clear();
- ItemStack potato = new ItemStack(Material.BAKED_POTATO);
- ItemMeta potatoMeta = potato.getItemMeta();
- potatoMeta.setDisplayName(GOLD+""+BOLD+"Potato Smash");
- potatoMeta.addEnchant(Enchantment.KNOCKBACK, 6, true);
- potato.setItemMeta(potatoMeta);
- online.getInventory().addItem(potato);
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+YELLOW+" Teleporting To Arena");
- int x = yamlFile.getInt("pos2.x");
- int y = yamlFile.getInt("pos2.y");
- int z = yamlFile.getInt("pos2.z");
- int yaw = yamlFile.getInt("pos2.yaw");
- int pitch = yamlFile.getInt("pos2.pitch");
- Location loc2 = new Location(world, x + 0.5, y, z + 0.5, yaw, pitch);
- online.teleport(loc2);
- m.add(online.getName());
- online.getInventory().clear();
- ItemStack potato = new ItemStack(Material.BAKED_POTATO);
- ItemMeta potatoMeta = potato.getItemMeta();
- potatoMeta.setDisplayName(GOLD+""+BOLD+"Potato Smash");
- potatoMeta.addEnchant(Enchantment.KNOCKBACK, 6, true);
- potato.setItemMeta(potatoMeta);
- online.getInventory().addItem(potato);
- }
- }
- number--;
- }else if(number == 5){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 5");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 5");
- }
- }
- number--;
- }else if(number == 4){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 4");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 4");
- }
- }
- number--;
- }else if(number == 3){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 3");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 3");
- }
- }
- number--;
- }else if(number == 2){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 2");
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 2");
- }
- }
- number--;
- }else if(number == 1){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 1");
- a1.add(online.getName());
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GOLD+""+BOLD+" Game Starts In 1");
- a2.add(online.getName());
- }
- }
- number--;
- }else if(number == 0){
- for(Player online : Bukkit.getOnlinePlayers()) {
- if(p1.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GREEN+""+BOLD+" Time To Smash!");
- m.clear();
- p1.clear();
- }
- if(p2.contains(online.getName())) {
- online.sendMessage(WHITE+"["+GOLD+""+BOLD+"P"+YELLOW+""+BOLD+"S"+WHITE+"]"+GREEN+""+BOLD+" Time To Smash!");
- m.clear();
- p2.clear();
- }
- }
- number--;
- }
- if(number == -1){
- Bukkit.getScheduler().cancelAllTasks();
- number = 11;
- }
- }
- }
- }, 20, 20);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement