private IMyPlayer FindPlayer(IMyEngineerToolBase handTool)
        {
            List <IMyPlayer> players = new List <IMyPlayer>();

            MyAPIGateway.Players.GetPlayers(players);

            foreach (IMyPlayer player in players)
            {
                IMyCharacter character = player.Controller.ControlledEntity as IMyCharacter;

                if (character == null)
                {
                    continue;
                }

                // The most inefficient way of finding which player is equiped with what tool.
                // What is needed is either MyCharacter.CurrentWeapon, or MyEngineerToolBase.Owner exposed through the appropriate interface.
                MyObjectBuilder_Character c = character.GetObjectBuilder(true) as MyObjectBuilder_Character;
                if (c != null && c.HandWeapon != null && c.HandWeapon.EntityId == handTool.EntityId)
                {
                    return(player);
                }
            }

            return(null);
        }