本文整理汇总了Java中mods.battlegear2.api.quiver.QuiverArrowRegistry.isKnownArrow方法的典型用法代码示例。如果您正苦于以下问题:Java QuiverArrowRegistry.isKnownArrow方法的具体用法?Java QuiverArrowRegistry.isKnownArrow怎么用?Java QuiverArrowRegistry.isKnownArrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mods.battlegear2.api.quiver.QuiverArrowRegistry
的用法示例。
在下文中一共展示了QuiverArrowRegistry.isKnownArrow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canShootArrow
import mods.battlegear2.api.quiver.QuiverArrowRegistry; //导入方法依赖的package包/类
/**
* Returns true if this bow's level is capable of shooting the given arrow
*/
public boolean canShootArrow(EntityPlayer player, ItemStack bow, ItemStack arrowStack) {
Item arrowItem = (arrowStack == null ? null : arrowStack.getItem());
if (arrowMap.containsKey(arrowItem)) {
if (player.capabilities.isCreativeMode) {
return true;
} else if (arrowItem instanceof IMagicArrow) {
if (!ZSSPlayerInfo.get(player).canUseMagic() || ZSSPlayerInfo.get(player).getCurrentMagic() < ((IMagicArrow) arrowItem).getMagicCost(arrowStack, player)) {
return false;
}
}
if (elementalArrowMap.containsKey(arrowItem)) {
int n = getLevel(bow);
if (n < 3) {
return (n == 2 && elementalArrowMap.get(arrowItem) != ElementType.LIGHT);
}
}
return true;
}
// allow hero's bow to fire arrows registered with BG2
return ZSSMain.isBG2Enabled && QuiverArrowRegistry.isKnownArrow(arrowStack);
}
示例2: isCraftableWithArrows
import mods.battlegear2.api.quiver.QuiverArrowRegistry; //导入方法依赖的package包/类
@Override
public boolean isCraftableWithArrows(ItemStack stack, ItemStack arrows) {
return QuiverArrowRegistry.isKnownArrow(arrows);
}