本文整理汇总了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;
}
示例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;
}
}
示例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;
}
示例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);
}