本文整理汇总了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;
}