/*     */   @EventHandler
/*     */   public void onPlayerDeath(PlayerDeathEvent event)
/*     */   {
/* 107 */     if (Main.getAPI().isBeingSpectated(event.getEntity()))
/*     */     {
/* 109 */       for (Player p : Main.getAPI().getSpectators(event.getEntity()))
/*     */       {
/* 111 */         if ((Main.getAPI().getSpectateMode(p) == SpectateMode.SCROLL) || (Main.getAPI().isScanning(p)))
/*     */         {
/* 113 */           SpectateScrollEvent scrollEvent = new SpectateScrollEvent(p, Main.getAPI().getSpectateablePlayers(), ScrollDirection.RIGHT);
/* 114 */           Bukkit.getServer().getPluginManager().callEvent(scrollEvent);
/*     */ 
/* 116 */           ArrayList<Player> playerList = scrollEvent.getSpectateList();
/*     */ 
/* 118 */           playerList.remove(p);
/* 119 */           playerList.remove(event.getEntity());
/*     */ 
/* 121 */           p.sendMessage(ChatColor.GRAY + "The person you were previously spectating has died.");
/*     */ 
/* 123 */           if (!Main.getAPI().scrollRight(p, playerList))
/*     */           {
/* 125 */             Main.getAPI().stopSpectating(p, true);
/* 126 */             p.sendMessage(ChatColor.GRAY + "You were forced to stop spectating because there is nobody left to spectate.");
/*     */           }
/*     */ 
/*     */         }
/*     */         else
/*     */         {
/* 132 */           Main.getAPI().stopSpectating(p, true);
/* 133 */           p.sendMessage(ChatColor.GRAY + "You were forced to stop spectating because the person you were spectating died.");
/*     */         }
/*     */ 
/*     */       }
/*     */ 
/* 139 */       return;
/*     */     }
/*     */   }