예제 #1
0
 @EventHandler
 public void onEntityShootBow(EntityShootBowEvent event) {
   if (!ScrimMatchHandler.isRunning()) {
     event.setCancelled(true);
     return;
   }
   if (event.getEntity() instanceof Player) {
     if (ScrimTeamHandler.isObserver((Player) event.getEntity())) {
       event.setCancelled(true);
     }
   }
 }
예제 #2
0
 @EventHandler
 public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
   if (!ScrimMatchHandler.isRunning() || !Scrimmage.pvp) {
     event.setCancelled(true);
     return;
   }
   if (event.getDamager() instanceof Player) {
     Player damager = (Player) event.getDamager();
     if (ScrimTeamHandler.isObserver(damager)) {
       event.setCancelled(true);
       return;
     }
   } else if (event.getDamager() instanceof Projectile) {
     Projectile proj = (Projectile) event.getDamager();
     if (proj.getShooter() instanceof Player) {
       Player shooter = (Player) proj.getShooter();
       if (ScrimTeamHandler.isObserver(shooter)) {
         event.setCancelled(true);
         return;
       }
     }
   }
 }
예제 #3
0
 @EventHandler
 public void onCreatureSpawn(CreatureSpawnEvent event) {
   if (!ScrimMatchHandler.isRunning() || event.getEntity() instanceof Monster) {
     event.setCancelled(true);
   }
 }
예제 #4
0
 @EventHandler
 public void onEntityExplode(EntityExplodeEvent event) {
   if (!ScrimMatchHandler.isRunning()) {
     event.setCancelled(true);
   }
 }
예제 #5
0
 @EventHandler
 public void onEntityBlockForm(EntityBlockFormEvent event) {
   if (!ScrimMatchHandler.isRunning()) {
     event.setCancelled(true);
   }
 }