本文整理汇总了Java中thaumcraft.api.ThaumcraftApiHelper.consumeVisFromWand方法的典型用法代码示例。如果您正苦于以下问题:Java ThaumcraftApiHelper.consumeVisFromWand方法的具体用法?Java ThaumcraftApiHelper.consumeVisFromWand怎么用?Java ThaumcraftApiHelper.consumeVisFromWand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thaumcraft.api.ThaumcraftApiHelper
的用法示例。
在下文中一共展示了ThaumcraftApiHelper.consumeVisFromWand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performTrigger
import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean performTrigger(World world, ItemStack wand, EntityPlayer player, int x, int y, int z, int side,
int event) {
ItemWandCasting casting = (ItemWandCasting) wand.getItem();
if (event == id)
if (executionCondition(world, wand, player, x, y, z, side, event))
if (consumeAspects.size() == 0
|| ThaumcraftApiHelper.consumeVisFromWand(wand, player, consumeAspects, true, false))
return executeAction(world, wand, player, x, y, z, side, event);
return true;
}
示例2: executionCondition
import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean executionCondition(World world, ItemStack wand, EntityPlayer player, int x, int y, int z, int side,
int event) {
int meta = world.getBlockMetadata(x, y, z);
return player.isSneaking()
? ThaumUtils.isComplete(player, TOThaum.riRawCluster)
&& ThaumcraftApiHelper.consumeVisFromWand(wand, player,
new AspectList().add(primals[meta], TOConfig.generalWandVisCountPrimal * 100)
.add(Aspect.ORDER, TOConfig.generalWandVisCountPrimal * 100),
true, false)
: ThaumcraftApiHelper.consumeVisFromWand(wand, player,
new AspectList().add(Aspect.ENTROPY, TOConfig.generalWandVisCount * 100), true, false);
}
示例3: onPlayerStoppedUsingFocus
import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world,
EntityPlayer player, int count) {
int j = 72000 - count;
ArrowLooseEvent event = new ArrowLooseEvent(player, itemstack, j);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
{
return;
}
j = event.charge;
if (player.capabilities.isCreativeMode||ThaumcraftApiHelper.consumeVisFromWand(itemstack, player, visCost, true,false))
{
float f = (float)j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if ((double)f < 0.1D)
{
return;
}
if (f > 1.0F)
{
f = 1.0F;
}
EntityIlluminatedArrow arrow = new EntityIlluminatedArrow(world, player, 2.0F*f);
arrow.setDamage(0);
arrow.setDeadOnLand(true);
arrow.isMagic(true);
world.playSoundAtEntity(player, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
if (!world.isRemote) {
world.spawnEntityInWorld(arrow);
}
}
else
{
world.playSoundAtEntity(player, "thaumcraft:craftfail", 1.0F, 1.0F);
}
}
示例4: onFocusRightClick
import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world,
EntityPlayer player, MovingObjectPosition mop) {
player.swingItem();
if (mop != null && ThaumcraftApiHelper.consumeVisFromWand(itemstack, player, visCost.copy(), true, false)) {
int x = mop.blockX;
int y = mop.blockY;
int z = mop.blockZ;
switch (mop.sideHit) {
case (0): {
y--;
break;
}
case (1): {
y++;
break;
}
case (2): {
z--;
break;
}
case (3): {
z++;
break;
}
case (4): {
x--;
break;
}
case (5): {
x++;
break;
}
}
if (world.getBlock(x, y, z).isReplaceable(world, x, y, z) || world.isAirBlock(x, y, z))
{
ItemStack focusStack = ((ItemWandCasting) itemstack.getItem()).getFocusItem(itemstack);
world.setBlock(x, y, z, TCBlocks.nitorColour);
TileColouredNitor te = (TileColouredNitor) world.getTileEntity(x, y, z);
te.setColour(getColour(focusStack));
world.playSoundEffect(mop.blockX + 0.5D, mop.blockY + 0.5D, mop.blockZ + 0.5D, "thaumcraft:zap", 0.25F, 1.0F);
}
}
return itemstack;
}