本文整理汇总了Java中org.bukkit.Material.ENDER_STONE属性的典型用法代码示例。如果您正苦于以下问题:Java Material.ENDER_STONE属性的具体用法?Java Material.ENDER_STONE怎么用?Java Material.ENDER_STONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.ENDER_STONE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerInteract
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { // This check needs to be there, 'cause RightClickAction has only the getType function, LeftClickAction doesnt and boooom!!
Player player = (Player) e.getPlayer();
ItemStack item = e.getItem();
Block block = e.getClickedBlock();
String bankId = BukkitUtils.getNBTTag(item, "bankid");
if (item == null || block == null) return;
if (bankId != null && bankId.length() > 0 && item.getType() == Material.PAPER && block.getType() == Material.ENDER_STONE) {
// got a foreign card?
if (!bankId.equals(player.getUniqueId().toString())) {
player.getInventory().remove(item);
BankomatCommand.appendCreditCardToUser(player);
}
player.openInventory(bankUi); // Dispatch our event by opening bankUi here:
}
}
}