示例#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);
   }
 }