/** * Gets whether or not the ClickType for this event represents a left * click. * * @return true if the ClickType uses the left mouse button. * @see ClickType#isLeftClick() */ public boolean isLeftClick() { return click.isLeftClick(); }
/** * Gets whether or not the ClickType for this event represents a left * click. * * @return true if the ClickType uses the left mouse button. * @see ClickType#isLeftClick() */ public boolean isLeftClick() { return click.isLeftClick(); }
@Override public boolean isLeftClick() { return ic.getClick().isLeftClick(); }
public static boolean transferItems(InventoryView view, int fromSlot, ClickType click) { boolean success = false; if (click.isLeftClick()) { success = transferItems(view, fromSlot); } else if (click.isRightClick()) { success = transferOneItem(view, fromSlot); } return success; }
@EventHandler public void inventoryClick(InventoryClickEvent e) { if (e.getInventory().getHolder() instanceof SoundLibraryHolder) { e.setCancelled(true); if (e.getCurrentItem() == null || e.getCurrentItem().getType().equals(Material.AIR) || e.getRawSlot() >= e.getInventory().getSize()) { return; } SoundLibraryHolder soundLibraryHolder = ((SoundLibraryHolder) e.getInventory().getHolder()); int i = e.getRawSlot(); if (i == 47) { openInventory((Player) e.getWhoClicked(), soundLibraryHolder.PAGE - 1, soundLibraryHolder.SEARCH); } else if (i == 51) { openInventory((Player) e.getWhoClicked(), soundLibraryHolder.PAGE + 1, soundLibraryHolder.SEARCH); } else { Sound sound = soundLibraryHolder.SOUNDS_DATA.get(e.getRawSlot()); if (e.getClick().isKeyboardClick()) { ((Player) e.getWhoClicked()).playSound(e.getWhoClicked().getLocation(), sound, 1f, 0f); } else if (e.getClick().isLeftClick()) { ((Player) e.getWhoClicked()).playSound(e.getWhoClicked().getLocation(), sound, 1f, 1f); } else if (e.getClick().isRightClick()) { ((Player) e.getWhoClicked()).playSound(e.getWhoClicked().getLocation(), sound, 1f, 2f); } else if (e.getClick().isCreativeAction()) { TLocale.sendTo(e.getWhoClicked(), "COMMANDS.TABOOLIB.SOUNDS.RESULT.COPY", sound.name()); } } } }