當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.EXP_BOTTLE屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.EXP_BOTTLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.EXP_BOTTLE屬性的具體用法?Java Material.EXP_BOTTLE怎麽用?Java Material.EXP_BOTTLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.EXP_BOTTLE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isInteractableItem

/**
 * checks if this item is interactable
 */
public static boolean isInteractableItem(ItemStack item) {
	if (item == null || item.getType() == Material.AIR) {
		return false;
	}
	if (item.getType().isBlock()) {
		return true;
	}
	if (item.getType() == Material.REDSTONE || item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET) {
		return true;
	}
	if (item.getType() == Material.MONSTER_EGG) {
		return true;
	}
	if (item.getType() == Material.EGG || item.getType() == Material.SNOW_BALL || item.getType() == Material.BOW || item.getType() == Material.ENDER_PEARL || item.getType() == Material.EYE_OF_ENDER || item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.EXP_BOTTLE || item.getType() == Material.FIREWORK_CHARGE) {
		return true;
	}
	if (item.getType().isEdible()) {
		return true;
	}
	return false;
}
 
開發者ID:RoboTricker,項目名稱:Transport-Pipes,代碼行數:24,代碼來源:HitboxUtils.java

示例2: createExpBottle

/**
 * Builds a bottled exp {@link ItemStack} based on the experience.
 *
 * @param experience
 *            the experience to create with
 * @return the {@link ItemStack}
 */
private ItemStack createExpBottle(int experience) {
    ItemStack stack = new ItemStack(Material.EXP_BOTTLE, 1);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName(BOTTLED_EXP_DISPLAY_NAME);
    meta.setLore(Lists.newArrayList(ChatColor.WHITE.toString() + experience + ChatColor.GOLD + " Experience"));
    stack.setItemMeta(meta);
    return stack;
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:15,代碼來源:BottledExpListener.java

示例3: XPVillagerTrade

public XPVillagerTrade(int xp, ItemStack RewardItem) {
	super(new ItemStack(Material.EXP_BOTTLE, xp), RewardItem);
	setXP(xp);
}
 
開發者ID:Ldcr993519867,項目名稱:BedwarsXP,代碼行數:4,代碼來源:XPVillagerTrade.java

示例4: meleeEnchantGUI

public static void meleeEnchantGUI(Player player){
    meleeGUI = Bukkit.createInventory(null, 9, ChatColor.DARK_GRAY + "Melee Enchantments");

    ItemStack filler = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 7);
    ItemMeta fillerMeta = filler.getItemMeta();
    fillerMeta.setDisplayName(ChatColor.GRAY + "");
    filler.setItemMeta(fillerMeta);

    ItemStack back = new ItemStack(Material.ARROW);
    ItemMeta backMeta = back.getItemMeta();
    backMeta.setDisplayName(ChatColor.RED + "Previous");
    back.setItemMeta(backMeta);

    ItemStack thunderingStrike = new ItemStack(Material.BLAZE_ROD);
    ItemMeta thunderMeta = thunderingStrike.getItemMeta();
    thunderMeta.setDisplayName(ChatColor.GOLD + "Thundering Strike");
    thunderMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Thundering Strike").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Thundering Strike").getRarity().getName()));
    thunderingStrike.setItemMeta(thunderMeta);

    ItemStack lifeSteal = new ItemStack(Material.FLINT);
    ItemMeta lifeStealMeta = lifeSteal.getItemMeta();
    lifeStealMeta.setDisplayName(ChatColor.RED + "Life Steal");
    lifeStealMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Life Steal").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Life Steal").getRarity().getName()));
    lifeSteal.setItemMeta(lifeStealMeta);

    ItemStack lastHope = new ItemStack(Material.GHAST_TEAR);
    ItemMeta lastHopeMeta = lastHope.getItemMeta();
    lastHopeMeta.setDisplayName(ChatColor.LIGHT_PURPLE + "Last Hope");
    lastHopeMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Last Hope").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Last Hope").getRarity().getName()));
    lastHope.setItemMeta(lastHopeMeta);

    ItemStack EXPSteal = new ItemStack(Material.EXP_BOTTLE);
    ItemMeta EXPStealMeta = EXPSteal.getItemMeta();
    EXPStealMeta.setDisplayName(ChatColor.GREEN + "Experience Steal");
    EXPStealMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Experience Steal").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Experience Steal").getRarity().getName()));
    EXPSteal.setItemMeta(EXPStealMeta);

    meleeGUI.setItem(0, filler);
    meleeGUI.setItem(1, thunderingStrike);
    meleeGUI.setItem(2, filler);
    meleeGUI.setItem(3, lifeSteal);
    meleeGUI.setItem(4, filler);
    meleeGUI.setItem(5, lastHope);
    meleeGUI.setItem(6, filler);
    meleeGUI.setItem(7, EXPSteal);
    meleeGUI.setItem(8, back);

    player.openInventory(meleeGUI);
}
 
開發者ID:Warvale,項目名稱:Scorch,代碼行數:49,代碼來源:EnchantsCommand.java

示例5: shopInvent

public Inventory shopInvent(){
	Inventory inv = Bukkit.createInventory(null, 36, shopName);
	
	ItemStack str = new ItemStack(Material.POTION, 1, (short) 8201);
	ItemMeta strM = str.getItemMeta();
	List<String> strL = new ArrayList<String>();
	strM.setDisplayName(ChatColor.RED + "Strength");
	strL.add(ChatColor.GOLD + "120 Tokens");
	strM.setLore(strL);
	str.setItemMeta(strM);
	inv.addItem(str);
	
	ItemStack gaps = new ItemStack(Material.GOLDEN_APPLE, 2, (short) 1);
	ItemMeta gapsM = gaps.getItemMeta();
	List<String> gapsL = new ArrayList<String>();
	gapsM.setDisplayName(ChatColor.RED + "Golden Apple");
	gapsL.add(ChatColor.GOLD + "10 Tokens");
	gapsM.setLore(gapsL);
	gaps.setItemMeta(gapsM);
	inv.addItem(gaps);
	
	for(int i = 0; i < 6; i++){
		inv.addItem(getItemSpacer());
	}
	
	ItemStack ljm = new ItemStack(Material.DAYLIGHT_DETECTOR);
	ItemMeta ljmM = ljm.getItemMeta();
	List<String> ljmL = new ArrayList<String>();
	ljmM.setDisplayName(ChatColor.RED + "Leave/Join Messages");
	ljmL.add(ChatColor.GOLD + "400 Tokens");
	ljmM.setLore(ljmL);
	ljm.setItemMeta(ljmM);
	inv.addItem(ljm);
	
	ItemStack exp = new ItemStack(Material.EXP_BOTTLE,20);
	ItemMeta expM = exp.getItemMeta();
	List<String> expL = new ArrayList<String>();
	expM.setDisplayName(ChatColor.RED + "Experience Bottles");
	expL.add(ChatColor.GOLD + "1 Token");
	expM.setLore(expL);
	exp.setItemMeta(expM);
	inv.addItem(exp);
	
	// remove the item spacers
	inv.remove(Material.STAINED_GLASS_PANE);
	
	return inv;
}
 
開發者ID:OverloadedCore,項目名稱:kaosEssentials,代碼行數:48,代碼來源:Core.java

示例6: shopClick

@EventHandler
public void shopClick(InventoryClickEvent e){
	if(e.getInventory().getName().equals(shopName) && e.getRawSlot() > 36){
		e.setCancelled(true);
		return;
	}
	if(e.getClickedInventory() == null){
		e.setCancelled(true);
		return;
	}
	if(e.getClickedInventory().getName() == null){
		e.setCancelled(true);
		return;
	}
	if(e.getClickedInventory().getName().equals(shopName)){
		Player p = (Player) e.getWhoClicked();
		String uuid = p.getUniqueId().toString();
		long tokens = getTokens(uuid);
		e.setCancelled(true);
		if(! e.getCurrentItem().hasItemMeta()) return;
		String name = e.getCurrentItem().getItemMeta().getDisplayName();
		if(name.equals(ChatColor.RED + "Strength")){
			if(tokens < 120){
				p.sendMessage(tag + ChatColor.RED + "You don\'t have enough tokens!");
				p.closeInventory();
			}else{
				ItemStack str = new ItemStack(Material.POTION, 1, (short) 8201);
				p.getInventory().addItem(str);
				setTokens(uuid, getTokens(uuid) - 120);
				p.sendMessage(tag + ChatColor.BLUE + "Your purchase was a success");
			}
		}
		if(name.equals(ChatColor.RED + "Golden Apple")){
			if(tokens < 10){
				p.sendMessage(tag + ChatColor.RED + "You don\'t have enough tokens!");
				p.closeInventory();
			}else{
				ItemStack gaps = new ItemStack(Material.GOLDEN_APPLE, 2, (short) 1);
				p.getInventory().addItem(gaps);
				setTokens(uuid, getTokens(uuid) - 10);
				p.sendMessage(tag + ChatColor.BLUE + "Your purchase was a success");
			}
		}
		if(name.equals(ChatColor.RED + "Leave/Join Messages")){
			if(tokens < 400){
				p.sendMessage(tag + ChatColor.RED + "You don\'t have enough tokens!");
				p.closeInventory();
			}else{
				if(isSjm(uuid)){
					p.sendMessage(tag + ChatColor.RED + "You already have this!");
					p.closeInventory();
				}else{
					setSjm(uuid, true);
					setTokens(uuid, getTokens(uuid) - 400);
					p.sendMessage(tag + ChatColor.BLUE + "Your purchase was a success");
				}
			}
		}
		if(name.equals(ChatColor.RED + "Experience Bottles")){
			if(tokens < 1){
				p.sendMessage(tag + ChatColor.RED + "You don\'t have enough tokens!");
				p.closeInventory();
			}else{
				ItemStack exp = new ItemStack(Material.EXP_BOTTLE,20);
				p.getInventory().addItem(exp);
				setTokens(uuid, getTokens(uuid) - 1);
				p.sendMessage(tag + ChatColor.BLUE + "Your purchase was a success");
			}
		}
	}
}
 
開發者ID:OverloadedCore,項目名稱:kaosEssentials,代碼行數:71,代碼來源:Core.java


注:本文中的org.bukkit.Material.EXP_BOTTLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。