Bound tools should drain LP (#1033)

(cherry picked from commit 59920ef)
This commit is contained in:
Nicholas Ignoffo 2017-02-05 12:42:28 -08:00
parent 86ea69eaca
commit d0e9174446
2 changed files with 16 additions and 3 deletions

View file

@ -5,10 +5,12 @@ import java.util.List;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.util.Utils;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
@ -70,6 +72,13 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
return super.onItemRightClick(world, player, hand);
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected)
{
if (entity instanceof EntityPlayer && getActivated(stack) && world.getTotalWorldTime() % 80 == 0)
NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage((EntityPlayer) entity, 20);
}
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
{