本文整理匯總了Java中org.bukkit.event.inventory.ClickType.SHIFT_LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java ClickType.SHIFT_LEFT屬性的具體用法?Java ClickType.SHIFT_LEFT怎麽用?Java ClickType.SHIFT_LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.event.inventory.ClickType
的用法示例。
在下文中一共展示了ClickType.SHIFT_LEFT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onIdeasClick
private void onIdeasClick(InventoryClickEvent event) {
event.setCancelled(true);
PageGUI.playSound(event);
ItemStack button = event.getCurrentItem();
if (button == null) {
return;
}
HumanEntity player = event.getWhoClicked();
if (button.equals(BACK)) {
openGroups(player);
return;
} else if (!faction.isPrivileged(player)) {
return;
}
Idea idea = IdeaGroup.getIdeaByIcon(button);
if (faction.getIdeaGroups().contains(idea.getGroup()) && !faction.getIdeas().contains(idea) && event.getClick() == ClickType.SHIFT_LEFT) {
boolean purchased = idea.purchase(faction);
MessageUtil.sendMessage(player, (purchased ? FMessage.MISC_PURCHASE_SUCCESS : FMessage.MISC_PURCHASE_FAIL).getMessage(idea.getName()));
}
openIdeas(player, idea.getGroup());
}
示例2: onGroupsClick
private void onGroupsClick(InventoryClickEvent event) {
HumanEntity player = event.getWhoClicked();
ItemStack button = event.getCurrentItem();
event.setCancelled(true);
PageGUI.playSound(event);
IdeaGroup group = IdeaGroup.getByIcon(button);
if (event.getClick() == ClickType.SHIFT_LEFT) {
boolean selected = group.select(faction);
MessageUtil.sendMessage(player, (selected ? FMessage.IDEA_MENU_GROUPS_SELECTED : FMessage.IDEA_MENU_GROUPS_DESELECTED).getMessage(group.getName()));
openGroups(player);
} else {
openIdeas(player, group);
}
}
示例3: onClick
public boolean onClick(VPPlayer clicker, int slot, Long coolDownUntil, MenuLink ml,
InventoryClickEvent event) {
Icon icon = this.getIcon(clicker, slot);
if (icon != null) {
event.setCancelled(!icon.canMove(clicker));
long now = System.currentTimeMillis();
if (coolDownUntil == null || coolDownUntil < now) {
if(icon.closeOnClick())
clicker.getPlayer().closeInventory();
if(icon.onClick(clicker, event.getClick(), ml)){
return true;
}
}
}
if(!event.isCancelled()) {
if(event.getClick() == ClickType.DOUBLE_CLICK || event.getClick() == ClickType.SHIFT_LEFT || event.getClick() == ClickType.SHIFT_RIGHT || event.getClick() == ClickType.NUMBER_KEY) {
ItemStack item = event.getCurrentItem();
if(item != null && item.getType() != Material.AIR && MinecraftUtils.getExtra(item, Icon.FREEZE).equals("1"))
event.setCancelled(true);
else if(event.getClick() == ClickType.NUMBER_KEY){
item = event.getWhoClicked().getInventory().getItem(event.getHotbarButton());
if(item != null && item.getType() != Material.AIR && MinecraftUtils.getExtra(item, Icon.FREEZE).equals("1"))
event.setCancelled(true);
}
}
}
return false;
}