当前位置: 首页>>代码示例>>Java>>正文


Java Material.LINGERING_POTION属性代码示例

本文整理汇总了Java中org.bukkit.Material.LINGERING_POTION属性的典型用法代码示例。如果您正苦于以下问题:Java Material.LINGERING_POTION属性的具体用法?Java Material.LINGERING_POTION怎么用?Java Material.LINGERING_POTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.LINGERING_POTION属性的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: howMuchSpaceForItemAsync

@Override
public int howMuchSpaceForItemAsync(WrappedDirection insertDirection, ItemStack insertion) {
	if (!cachedChunk.isLoaded()) {
		return 0;
	}
	if (isInvLocked(cachedBrewingStand)) {
		return 0;
	}
	if (insertion.getType() == Material.POTION || insertion.getType() == Material.SPLASH_POTION || insertion.getType() == Material.LINGERING_POTION) {
		if (cachedInv.getItem(0) != null && cachedInv.getItem(1) != null && cachedInv.getItem(2) != null) {
			return 0;
		} else {
			return 1;
		}
	} else if (insertDirection.isSide() && insertion.getType() == Material.BLAZE_POWDER) {
		return howManyItemsFit(insertion, cachedInv.getFuel());
	} else if (isBrewingIngredient(insertion)) {
		return howManyItemsFit(insertion, cachedInv.getIngredient());
	} else {
		return 0;
	}
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:22,代码来源:BrewingStandContainer.java

示例3: insertItem

@Override
public ItemStack insertItem(WrappedDirection insertDirection, ItemStack insertion) {
	if (!cachedChunk.isLoaded()) {
		return insertion;
	}
	if (isInvLocked(cachedBrewingStand)) {
		return insertion;
	}
	if (insertion.getType() == Material.POTION || insertion.getType() == Material.SPLASH_POTION || insertion.getType() == Material.LINGERING_POTION) {
		if (cachedInv.getItem(0) == null) {
			cachedInv.setItem(0, insertion);
			return null;
		} else if (cachedInv.getItem(1) == null) {
			cachedInv.setItem(1, insertion);
			return null;
		} else if (cachedInv.getItem(2) == null) {
			cachedInv.setItem(2, insertion);
			return null;
		}
	} else if (insertDirection.isSide() && insertion.getType() == Material.BLAZE_POWDER) {
		ItemStack oldFuel = cachedInv.getFuel();
		cachedInv.setFuel(putItemInSlot(insertion, oldFuel));
		if (insertion == null || insertion.getAmount() == 0) {
			insertion = null;
		}
	} else if (isBrewingIngredient(insertion)) {
		ItemStack oldIngredient = cachedInv.getIngredient();
		cachedInv.setIngredient(putItemInSlot(insertion, oldIngredient));
		if (insertion == null || insertion.getAmount() == 0) {
			insertion = null;
		}
	}
	return insertion;

}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:35,代码来源:BrewingStandContainer.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.LINGERING_POTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。