当前位置: 首页>>代码示例>>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;未经允许,请勿转载。