當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。