auto30

WTF?!?!

Aug 7th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  final public HashSet<String> playing = new HashSet<String>();
  2.    
  3.     @EventHandler
  4.     public void onDeath(PlayerDeathEvent event){
  5.        
  6.          if(playing.contains(event.getEntity().getName())){ //error here?
  7.              
  8.             if(event.getEntity().getName().equals(player1.getName())){ //
  9.              
  10.                 player2.sendMessage(getConfig().getString("Winner.message"));
  11.                 playing.remove(player2);
  12.                 playing.remove(player1);
  13.                 class Countdown implements Runnable {
  14.                     private int count;
  15.                     private int tid = -1;
  16.  
  17.                     Countdown(int count) {
  18.                         this.count = count;
  19.                     }
  20.  
  21.                     @Override
  22.                     public void run() {
  23.  
  24.                         final String fightMsg = (count + " seconds left in cleanup...");
  25.                         if(count == 30 || count == 15 || count == 10 || count <= 5){
  26.                         player2.sendMessage(fightMsg);
  27.                         }
  28.                         if (count == 0) {
  29.                             getServer().getScheduler().cancelTask(tid);
  30.                             player2.sendMessage(ChatColor.BLUE + "Teleporting to spawn...");
  31.                             player2.teleport(player2.getWorld().getSpawnLocation());
  32.                            
  33.                            
  34.                         } else count--;
  35.  
  36.                     }
  37.  
  38.                     void start() {
  39.                         tid = getServer().getScheduler().scheduleSyncRepeatingTask(Arena.this, this, 0, 20);
  40.                     }
  41.                 }
  42.  
  43.                
  44.                 new Countdown(getConfig().getInt("Cleanup.time")).start();
  45.  
  46.                 long x = getConfig().getInt("Cleanup.time") * 20;
  47.                 getServer().getScheduler().scheduleSyncDelayedTask(Arena.this, new Runnable() {
  48.  
  49.                        public void run() {
  50.                            Bukkit.broadcastMessage(ChatColor.GREEN + "The Olympiad arena is now open!");
  51.                            taken = false;
  52.                        }
  53.                     }, x);
  54.                
  55.              }
  56.             else if(event.getEntity().getName().equals(player2.getName())){
  57.                
  58.                 player1.sendMessage(getConfig().getString("Winner.message"));
  59.                 playing.remove(player2);
  60.                 playing.remove(player1);
  61.                
  62.                 class Countdown implements Runnable {
  63.                     private int count;
  64.                     private int tid = -1;
  65.  
  66.                     Countdown(int count) {
  67.                         this.count = count;
  68.                     }
  69.  
  70.                     @Override
  71.                     public void run() {
  72.  
  73.                         final String fightMsg = (count + " seconds left in cleanup..");
  74.                         if(count == 30 || count == 15 || count == 10 || count <= 5){
  75.                         player1.sendMessage(fightMsg);
  76.                         }
  77.  
  78.                         if (count == 0) {
  79.                             getServer().getScheduler().cancelTask(tid);
  80.                             player1.sendMessage(ChatColor.BLUE + "Teleporting to spawn...");
  81.                             player1.teleport(player2.getWorld().getSpawnLocation());
  82.                            
  83.                         } else count--;
  84.  
  85.                     }
  86.  
  87.                     void start() {
  88.                         tid = getServer().getScheduler().scheduleSyncRepeatingTask(Arena.this, this, 0, 20);
  89.                     }
  90.                 }
  91.  
  92.                
  93.                 new Countdown(getConfig().getInt("Cleanup.time")).start();
  94.                
  95.                 long x = getConfig().getInt("Cleanup.time") * 20;
  96.                 getServer().getScheduler().scheduleSyncDelayedTask(Arena.this, new Runnable() {
  97.  
  98.                        public void run() {
  99.                            Bukkit.broadcastMessage(ChatColor.GREEN + "The Olympiad arena is now open!");
  100.                            taken = false;
  101.                        }
  102.                     }, x);
  103.              }
  104.            
  105.         }
  106.        
  107.     }
Advertisement
Add Comment
Please, Sign In to add comment