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); } }
@Override protected Entity[] get(Event event) { return new Entity[]{((HangingEvent) event).getEntity()}; }
@EventHandler(priority = EventPriority.MONITOR) public void onHangingEvent(HangingEvent evt) { checkLocation(evt.getEntity().getLocation(), evt); }
@Override protected void onHangingEvent(HangingEvent event) { }
/** * Invoked whenever a registered hanging event is called. * * <p>Intended for optional override.</p> * * @param event The called event. */ protected void onHangingEvent(HangingEvent event) {}