当前位置: 首页>>代码示例>>Java>>正文


Java SoulNetworkHandler.syphonFromNetwork方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:SpitefulFox,项目名称:ForbiddenMagic,代码行数:20,代码来源:ItemBloodwell.java

示例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);
}
 
开发者ID:SpitefulFox,项目名称:ForbiddenMagic,代码行数:11,代码来源:ItemBloodwell.java

示例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;
        }
    }
    
}
 
开发者ID:SpitefulFox,项目名称:ForbiddenMagic,代码行数:48,代码来源:BloodStaffUpdate.java

示例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;
        }
    }
    
}
 
开发者ID:SpitefulFox,项目名称:ForbiddenMagic,代码行数:45,代码来源:BloodWandUpdate.java


注:本文中的WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler.syphonFromNetwork方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。