public void on(Object e) { if (!(e instanceof Event)) return; Event event = (Event) e; onEvent(event); if (event instanceof PlayerEvent) { onPlayerEvent((PlayerEvent)event); } else if (event instanceof BlockEvent) { onBlockEvent((BlockEvent)event); } else if (event instanceof HangingEvent) { onHangingEvent((HangingEvent)event); } else if (event instanceof InventoryEvent) { onInventoryEvent((InventoryEvent) event); } else if (event instanceof VehicleEvent) { onVehicleEvent((VehicleEvent) event); } else if (event instanceof EntityEvent) { onEntityEvent((EntityEvent) event); } }
@EventHandler(priority = EventPriority.MONITOR) public void onVehicleEvent(VehicleEvent evt) { checkLocation(evt.getVehicle().getLocation(), evt); }
@Override protected void onVehicleEvent(VehicleEvent event) { callEvent(event.getVehicle(), event); }
/** * Invoked whenever a registered vehicle event is called. * * <p>Intended for optional override.</p> * * @param event The called event. */ protected void onVehicleEvent(VehicleEvent event) {}