Beispiel #1
0
        public void attackTargetEntityWithCurrentItem(Entity entity)
        {
            int i = inventory.getDamageVsEntity(entity);

            if (i > 0)
            {
                entity.attackEntityFrom(this, i);
                ItemStack itemstack = getCurrentEquippedItem();
                if (itemstack != null && (entity is EntityLiving))
                {
                    itemstack.hitEntity((EntityLiving)entity);
                    if (itemstack.stackSize <= 0)
                    {
                        itemstack.func_577_a(this);
                        destroyCurrentEquippedItem();
                    }
                }
            }
        }
Beispiel #2
0
 public void attackTargetEntityWithCurrentItem(Entity entity)
 {
     int i = inventory.getDamageVsEntity(entity);
     if (i > 0)
     {
         entity.attackEntityFrom(this, i);
         ItemStack itemstack = getCurrentEquippedItem();
         if (itemstack != null && (entity is EntityLiving))
         {
             itemstack.hitEntity((EntityLiving) entity);
             if (itemstack.stackSize <= 0)
             {
                 itemstack.func_577_a(this);
                 destroyCurrentEquippedItem();
             }
         }
     }
 }
Beispiel #3
0
 public override void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
 {
     entity.attackEntityFrom(null, 1);
 }
Beispiel #4
0
 public override void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
 {
     entity.attackEntityFrom(null, 1);
 }