Example #1
0
        public override void LoadData()
        {
            Instance      = this;
            Log.ModName   = "Advanced Welding";
            Log.AutoClose = false;

            Networking.LogInfo      = (msg) => Log.Info(msg, null);
            Networking.LogError     = (err) => Log.Error(err);
            Networking.LogException = (ex) => Log.Error(ex);
            Networking.Register(ModContext);

            DetachHandler    = new DetachHandler(this);
            PrecisionHandler = new PrecisionHandler(this);
            WeldPadHandler   = new WeldPadHandler(this);
            MergeHandler     = new MergeHandler(this);

            if (Networking.IsPlayer)
            {
                GrinderHandler = new GrinderHandler(this);
                ChatCommands   = new ChatCommands(this);
                Notifications  = new Notifications(this);
            }

            if (MyAPIGateway.Session.IsServer)
            {
                GrindDamageHandler = new GrindDamageHandler(this);
            }
        }
Example #2
0
        public override void UpdateOnceBeforeFrame()
        {
            try
            {
                ThisPad = (IMyCubeBlock)Entity;
                if (ThisPad.CubeGrid?.Physics == null)
                {
                    return;
                }

                Handler = AdvancedWeldingMod.Instance.WeldPadHandler;
                Handler.Pads.Add(ThisPad);

                NeedsUpdate = MyEntityUpdateEnum.EACH_10TH_FRAME;
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }