Skip to content

Instantly share code, notes, and snippets.

@anna-is-cute
Last active August 29, 2015 14:03
Show Gist options
  • Save anna-is-cute/c2e3f144eedc18bd3d65 to your computer and use it in GitHub Desktop.
Save anna-is-cute/c2e3f144eedc18bd3d65 to your computer and use it in GitHub Desktop.
final AbstractEventRegistrar aer = new AbstractEventRegistrar(this);
aer.registerAbstractListener(InventoryEvent.class, new Listener() {
@EventHandler
public <T extends InventoryEvent> void onInventoryEvent(T e) {
if (e instanceof Cancellable) {
final Cancellable c = (Cancellable) e;
c.setCancelled(true);
}
}
}, EventPriority.HIGHEST);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment