コード例 #1
0
        public void AddExtension(string Extension, int version)
        {
            switch (Extension.Trim())
            {
            case CpeExt.ClickDistance:
                ClickDistance = version; break;

            case CpeExt.CustomBlocks:
                CustomBlocks = version;
                if (version == 1)
                {
                    SendCustomBlockSupportLevel(1);
                }
                hasCustomBlocks = true; break;

            case CpeExt.HeldBlock:
                HeldBlock = version; break;

            case CpeExt.TextHotkey:
                TextHotKey = version; break;

            case CpeExt.ExtPlayerList:
                ExtPlayerList = version;
                hasExtList    = version == 2; break;

            case CpeExt.EnvColors:
                EnvColors = version; break;

            case CpeExt.SelectionCuboid:
                SelectionCuboid = version; break;

            case CpeExt.BlockPermissions:
                BlockPermissions = version; break;

            case CpeExt.ChangeModel:
                UpdateModels();
                ChangeModel    = version;
                hasChangeModel = true; break;

            case CpeExt.EnvMapAppearance:
                EnvMapAppearance = version; break;

            case CpeExt.EnvWeatherType:
                EnvWeatherType = version; break;

            case CpeExt.HackControl:
                HackControl = version; break;

            case CpeExt.EmoteFix:
                EmoteFix = version; break;

            case CpeExt.MessageTypes:
                MessageTypes = version; break;

            case CpeExt.LongerMessages:
                LongerMessages = version; break;

            case CpeExt.FullCP437:
                FullCP437 = version; break;

            case CpeExt.BlockDefinitions:
                BlockDefinitions = version;
                hasBlockDefs     = true; break;

            case CpeExt.BlockDefinitionsExt:
                BlockDefinitionsExt = version; break;

            case CpeExt.TextColors:
                hasTextColors = true;
                TextColors    = version;

                for (int i = 0; i < Colors.ExtColors.Length; i++)
                {
                    if (Colors.ExtColors[i].Undefined)
                    {
                        continue;
                    }
                    Colors.SendSetTextColor(this, Colors.ExtColors[i]);
                }
                break;

            case CpeExt.BulkBlockUpdate:
                BulkBlockUpdate = version; break;
            }
        }