本文整理汇总了Java中WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler.syphonFromNetwork方法的典型用法代码示例。如果您正苦于以下问题:Java SoulNetworkHandler.syphonFromNetwork方法的具体用法?Java SoulNetworkHandler.syphonFromNetwork怎么用?Java SoulNetworkHandler.syphonFromNetwork使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler
的用法示例。
在下文中一共展示了SoulNetworkHandler.syphonFromNetwork方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdate
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入方法依赖的package包/类
@Override
public void onUpdate(ItemStack stack, World world, Entity fauxplayer, int z, boolean par5) {
if (Compat.bm && stack.getItemDamage() > 0 && stack.hasTagCompound()) {
EntityPlayer player = null;
if (fauxplayer instanceof EntityPlayer)
player = (EntityPlayer) fauxplayer;
else
return;
if (player.capabilities.isCreativeMode)
stack.setItemDamage(0);
else if (SoulNetworkHandler.syphonFromNetwork(stack, 25) > 0)
stack.setItemDamage(stack.getItemDamage() - 1);
else if (player.getHealth() > 6) {
player.setHealth(player.getHealth() - 2);
stack.setItemDamage(stack.getItemDamage() - 1);
}
}
}
示例2: setDamage
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入方法依赖的package包/类
@Override
public void setDamage(ItemStack stack, int damage) {
if (damage > 0) {
if (SoulNetworkHandler.syphonFromNetwork(stack, 25 * damage) > 0)
super.setDamage(stack, 0);
else
super.setDamage(stack, damage);
} else
super.setDamage(stack, damage);
}
示例3: onUpdate
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入方法依赖的package包/类
public void onUpdate(ItemStack itemstack, EntityPlayer player)
{
if(Compat.bm && Config.crossWand && player.ticksExisted % 25 == 0)
{
try
{
if(!checkHotbar(itemstack, player))
return;
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
int cost;
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("alchemical"))
cost = Config.bloodvis - 1;
else
cost = Config.bloodvis;
cost = Math.max(0, cost);
for(int x = 0;x < primals.length;x++)
{
int deficit = ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack) - ((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]);
if(deficit > 0)
{
deficit = Math.min(deficit, 100);
if(player.capabilities.isCreativeMode)
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
else if(SoulNetworkHandler.syphonFromNetwork(itemstack, cost * deficit) > 0)
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
else if(syphonHealth(player))
{
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
return;
}
else
return;
}
}
}
catch(Exception e)
{
return;
}
}
}
示例4: onUpdate
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入方法依赖的package包/类
public void onUpdate(ItemStack itemstack, EntityPlayer player)
{
if(Compat.bm && Config.crossWand && player.ticksExisted % 100 == 0)
{
try
{
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
int cost;
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("alchemical"))
cost = Config.bloodvis - 1;
else
cost = Config.bloodvis;
cost = Math.max(0, cost);
for(int x = 0;x < primals.length;x++)
{
int deficit = ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack) - ((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]);
if(deficit > 0)
{
deficit = Math.min(deficit, 100);
if(player.capabilities.isCreativeMode)
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
else if(SoulNetworkHandler.syphonFromNetwork(itemstack, cost * deficit) > 0)
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
else if(syphonHealth(player))
{
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
return;
}
else
return;
}
}
}
catch(Throwable e)
{
return;
}
}
}