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


Java Material.TIPPED_ARROW屬性代碼示例

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


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

示例1: init

@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) {
	switch (parseResult.mark) {
		case 0:
			material = Material.POTION;
			break;
		case 1:
			material = Material.SPLASH_POTION;
			break;
		case 2:
			material = Material.LINGERING_POTION;
			break;
		case 3:
			material = Material.TIPPED_ARROW;
			break;
		default:
			material = Material.POTION;
			break;
	}
	potionEffects = (Expression<PotionEffect>) expr[0];
	return true;
}
 
開發者ID:Syst3ms,項目名稱:QuarSK,代碼行數:22,代碼來源:ExprCustomPotionItem.java

示例2: getRepresentation

/**
 * {@inheritDoc}
 */
@Override
public default ItemStack getRepresentation() {
	ItemStack stack = new ItemStack(Material.TIPPED_ARROW);
	ItemMeta meta = stack.getItemMeta();
	meta.setDisplayName(ChatColor.GRAY + "Tipped Arrow");
	stack.setItemMeta(meta);
	return stack;
}
 
開發者ID:Jannyboy11,項目名稱:CustomRecipes,代碼行數:11,代碼來源:TippedArrowRecipe.java

示例3: onShootWithoutArrows

@SuppressWarnings("deprecation")
@EventHandler
public void onShootWithoutArrows(EntityShootBowEvent event)
{
	if(event.getEntity() instanceof Player)
	{
		Player player = (Player)event.getEntity();
		if(player.getInventory().getItemInMainHand().getType() == event.getBow().getType())
		{
			if
			(
				player.getInventory().getItemInOffHand().getType() == Material.ARROW
				|| player.getInventory().getItemInOffHand().getType() == Material.SPECTRAL_ARROW
				|| player.getInventory().getItemInOffHand().getType() == Material.TIPPED_ARROW
			)
			{
				event.setCancelled(false);
			}
			else
			{
				event.setCancelled(true);
				player.sendMessage(ChatColor.RED + Survival.Words.get("Must load Arrows on off hand"));
				player.updateInventory();
			}
		}
		else
		{
			event.setCancelled(true);
			player.sendMessage(ChatColor.RED + Survival.Words.get("Must use a Bow with main hand"));
			player.updateInventory();
		}
	}
}
 
開發者ID:FattyMieo,項目名稱:SurvivalPlus,代碼行數:33,代碼來源:Bow.java

示例4: isPotionItem

public static boolean isPotionItem(@NotNull ItemStack item) {
	return (item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION
			|| item.getType() == Material.LINGERING_POTION || item.getType() == Material.TIPPED_ARROW);
}
 
開發者ID:Syst3ms,項目名稱:QuarSK,代碼行數:4,代碼來源:PotionUtils.java


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