Ejemplo n.º 1
0
        private void AddPostHooks()
        {
            if (this.postGetDataHookHandler != null)
            {
                throw new InvalidOperationException("Post hooks already registered.");
            }

            this.postGetDataHookHandler           = new GetDataHookHandler(this, true);
            this.PostGetDataHookHandler.TileEdit += this.Net_PostTileEdit;
        }
Ejemplo n.º 2
0
        private void AddHooks()
        {
            if (this.getDataHookHandler != null)
            {
                throw new InvalidOperationException("Hooks already registered.");
            }

            this.getDataHookHandler                   = new GetDataHookHandler(this, true, 0);
            this.GetDataHookHandler.TileEdit         += this.Net_TileEdit;
            this.GetDataHookHandler.SignEdit         += this.Net_SignEdit;
            this.GetDataHookHandler.SignRead         += this.Net_SignRead;
            this.GetDataHookHandler.ChestPlace       += this.Net_ChestPlace;
            this.GetDataHookHandler.ChestOpen        += this.Net_ChestOpen;
            this.GetDataHookHandler.ChestRename      += this.Net_ChestRename;
            this.GetDataHookHandler.ChestGetContents += this.Net_ChestGetContents;
            this.GetDataHookHandler.ChestModifySlot  += this.Net_ChestModifySlot;
            this.GetDataHookHandler.ChestUnlock      += this.Net_ChestUnlock;
            this.GetDataHookHandler.HitSwitch        += this.Net_HitSwitch;
            this.GetDataHookHandler.DoorUse          += this.Net_DoorUse;
            this.GetDataHookHandler.PlayerSpawn      += this.Net_PlayerSpawn;

            ServerApi.Hooks.GameUpdate.Register(this, this.Game_Update);
            ServerApi.Hooks.WorldSave.Register(this, this.World_SaveWorld);
        }