本文整理汇总了Java中WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler类的典型用法代码示例。如果您正苦于以下问题:Java SoulNetworkHandler类的具体用法?Java SoulNetworkHandler怎么用?Java SoulNetworkHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SoulNetworkHandler类属于WayofTime.alchemicalWizardry.api.soulNetwork包,在下文中一共展示了SoulNetworkHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: castSpell
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
{
this.applyAllSpellEffects();
int cost = this.getTotalCost();
if(!SoulNetworkHandler.syphonAndDamageFromNetwork(itemStack, entityPlayer, cost))
{
return;
}
for (ISelfSpellEffect eff : selfSpellEffectList)
{
eff.onSelfUse(world, entityPlayer);
}
}
示例2: castSpell
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack crystal)
{
if (entityPlayer.worldObj.isRemote)
{
return;
}
int cost = this.getTotalCost();
if(!SoulNetworkHandler.syphonAndDamageFromNetwork(crystal, entityPlayer, cost))
{
return;
}
ItemStack toolStack = this.prepareTool(crystal, world);
entityPlayer.setCurrentItemOrArmor(0, toolStack);
this.onSummonTool(toolStack, world, entityPlayer);
}
示例3: onUpdate
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void onUpdate(ItemStack toolStack, World world, Entity par3Entity, int par4, boolean par5)
{
if (world.isRemote)
{
return;
}
SpellParadigmTool parad = this.loadParadigmFromStack(toolStack);
int cost = parad.onUpdate(toolStack, world, par3Entity, par4, par5);
if (par3Entity instanceof EntityPlayer && cost > 0)
SoulNetworkHandler.syphonAndDamageFromNetwork(toolStack, (EntityPlayer) par3Entity, cost);
int duration = Math.max(this.getDuration(toolStack, world), 0);
if (duration <= 0 && par3Entity instanceof EntityPlayer)
{
int banishCost = parad.onBanishTool(toolStack, world, par3Entity, par4, par5);
SoulNetworkHandler.syphonAndDamageFromNetwork(toolStack, (EntityPlayer) par3Entity, banishCost);
((EntityPlayer) par3Entity).inventory.mainInventory[par4] = this.getContainedCrystal(toolStack);
}
}
示例4: onEntityUpdate
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@SubscribeEvent
public void onEntityUpdate(LivingUpdateEvent event){
if(Compat.bm && event.entityLiving != null && event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote){
EntityPlayer player = (EntityPlayer)event.entityLiving;
String name = player.getDisplayName();
if(player.isPotionActive(DarkPotions.bloodSeal)){
try {
if (lastLP.containsKey(name)) {
if (SoulNetworkHandler.getCurrentEssence(name) > lastLP.get(name))
SoulNetworkHandler.setCurrentEssence(name, lastLP.get(name));
else
lastLP.put(name, SoulNetworkHandler.getCurrentEssence(name));
}
else
lastLP.put(name, SoulNetworkHandler.getCurrentEssence(name));
}
catch(Throwable e){
Compat.bm = false;
}
}
else if(lastLP.containsKey(name))
lastLP.remove(name);
}
}
示例5: 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);
}
}
}
示例6: hitEntity
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase player) {
stack.damageItem(1, player);
victim.motionY *= 0.8;
if (victim.hurtResistantTime > 18)
victim.hurtResistantTime -= 5;
if (Compat.bm & victim instanceof EntityPlayer) {
String target = ((EntityPlayer) victim).getDisplayName();
int lp = SoulNetworkHandler.getCurrentEssence(target);
int damage = Math.max(4000, lp / 4);
if (lp >= damage)
lp -= damage;
else
lp = 0;
SoulNetworkHandler.setCurrentEssence(target, lp);
victim.addPotionEffect(new PotionEffect(DarkPotions.bloodSeal.getId(), 1200));
}
return true;
}
示例7: castSpell
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void castSpell(World world, EntityPlayer entityPlayer,
ItemStack itemStack) {
SpellProperties properties = this.getSpellProperties(itemStack);
SoulNetworkHandler.syphonAndDamageFromNetwork(itemStack, entityPlayer,
properties.getCost());
EntitySpellProjectile entitySpellProjectile = new EntitySpellProjectile(
world, entityPlayer, properties);
if (!world.isRemote) {
world.spawnEntityInWorld(entitySpellProjectile);
}
}
示例8: onPlayerStoppedUsing
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void onPlayerStoppedUsing(ItemStack itemStack, World world,
EntityPlayer entityPlayer, int itemInUseCount) {
SoulNetworkHandler.checkAndSetItemOwner(itemStack, entityPlayer);
float castTime = (this.getMaxItemUseDuration(itemStack) - itemInUseCount) / 20.0F;
if (castTime >= 1.0f) {
this.castSpell(world, entityPlayer, itemStack);
}
}
示例9: onUpdate
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void onUpdate(ItemStack itemStack, World world,
Entity holdingEntity, int p_77663_4_, boolean inHand) {
if (!world.isRemote && holdingEntity instanceof EntityPlayer && inHand) {
if (((EntityPlayer) holdingEntity).getFoodStats().getFoodLevel() > 0) {
String playerName = SoulNetworkHandler
.getUsername(((EntityPlayer) holdingEntity));
if (SoulNetworkHandler.getCurrentEssence(playerName) < 1000) {
((EntityPlayer) holdingEntity).addExhaustion(2.0f);
SoulNetworkHandler.addCurrentEssenceToMaximum(playerName,
25, 1000);
}
}
}
}
示例10: castSpell
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void castSpell(World world, EntityPlayer entityPlayer,
ItemStack itemStack) {
SpellProperties properties = this.getSpellProperties(itemStack);
SoulNetworkHandler.syphonAndDamageFromNetwork(itemStack, entityPlayer,
properties.getCost());
SpellEffects.hitEntity(world, entityPlayer, properties);
}
示例11: castSpell
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
{
int cost = this.getTotalCost();
if(!SoulNetworkHandler.syphonAndDamageFromNetwork(itemStack, entityPlayer, cost))
{
return;
}
EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer);
this.prepareProjectile(proj);
world.spawnEntityInWorld(proj);
}
示例12: onItemRightClick
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par3EntityPlayer.isSneaking())
{
par3EntityPlayer.setCurrentItemOrArmor(0, this.getContainedCrystal(par1ItemStack));
return par1ItemStack;
}
SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack);
MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
int cost = 0;
if (mop != null && mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK))
{
cost = parad.onRightClickBlock(par1ItemStack, par3EntityPlayer, par2World, mop);
} else
{
cost = parad.onRightClickAir(par1ItemStack, par2World, par3EntityPlayer);
}
if (cost > 0)
{
SoulNetworkHandler.syphonAndDamageFromNetwork(par1ItemStack, par3EntityPlayer, cost);
}
return par1ItemStack;
}
示例13: 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);
}
示例14: onItemRightClick
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
if (itemstack.getItemDamage() >= 100) {
player.swingItem();
if (!world.isRemote) {
if (player.capabilities.isCreativeMode)
itemstack.setItemDamage(0);
else {
SoulNetworkHandler.syphonAndDamageFromNetwork(itemstack, player, 10000);
if(player.getHealth() > 0){
itemstack.setItemDamage(0);
}
else
return itemstack;
}
Aspect aspect;
short amount;
for(Iterator count = Aspect.getPrimalAspects().iterator(); count.hasNext(); PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspect.getTag(), Short.valueOf(amount), Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspect))), (EntityPlayerMP)player))
{
aspect = (Aspect)count.next();
amount = (short)(world.rand.nextInt(4) + 4);
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspect, amount);
ResearchManager.scheduleSave(player);
}
}
}
return itemstack;
}
示例15: onItemRightClick
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
if (!Compat.bm)
return itemstack;
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
if (world != null) {
double posX = player.posX;
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
}
if (world.isRemote) {
return itemstack;
}
NBTTagCompound itemTag = itemstack.stackTagCompound;
if (itemTag == null || itemTag.getString("ownerName").equals("")) {
return itemstack;
}
if(itemTag.getString("ownerName").equals(SoulNetworkHandler.getUsername(player)))
{
SoulNetworkHandler.setMaxOrbToMax(itemTag.getString("ownerName"), 6);
}
SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, 700000000);
hurtPlayer(player, 200);
return itemstack;
}