/** * Proxy method to {@link #setResult(Event.Result)} for the Cancellable * interface. {@link #setResult(Event.Result)} is preferred, as it allows * you to specify the Result beyond Result.DENY and Result.ALLOW. * <p> * {@inheritDoc} * * @param toCancel result becomes DENY if true, ALLOW if false */ public void setCancelled(boolean toCancel) { setResult(toCancel ? Result.DENY : Result.ALLOW); }
/** * Proxy method to {@link #setResult(Event.Result)} for the Cancellable * interface. {@link #setResult(Event.Result)} is preferred, as it allows * you to specify the Result beyond Result.DENY and Result.ALLOW. * <p> * {@inheritDoc} * * @param toCancel result becomes DENY if true, ALLOW if false */ public void setCancelled(boolean toCancel) { setResult(toCancel ? Result.DENY : Result.ALLOW); }
@Override public void setResult(MCResult newResult) { iie.setResult(Result.valueOf(newResult.name())); }
@EventHandler public void onInteract(final InventoryInteractEvent e) { if (GuiWindow.getWindow(e.getInventory().getTitle()) != null) { if (e.getInventory().getType().equals(InventoryType.CHEST)) { e.setResult(Event.Result.DENY); e.setCancelled(true); } } } }