Exemplo n.º 1
0
        private void MetroWindow_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            string path = System.IO.Directory.GetCurrentDirectory() + @"\docs\ReplaceItem.html";

            if (e.Key == System.Windows.Input.Key.F1)
            {
                if (System.IO.File.Exists(path))
                {
                    System.Diagnostics.Process.Start(path);
                }
                else
                {
                    this.ShowMessageAsync(FloatErrorTitle, FloatHelpFileCantFind, MessageDialogStyle.Affirmative, new MetroDialogSettings()
                    {
                        AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel
                    });
                }
            }
            else if (e.Key == System.Windows.Input.Key.F2)
            {
                FixColorCode fcc = new FixColorCode();
                if (finalStr != "")
                {
                    fcc.setStr(finalStr);
                }
                else
                {
                    fcc.setStr("");
                }
                fcc.ShowDialog();
                finalStr = fcc.getStr();
            }
        }
Exemplo n.º 2
0
        private void tabOther1WordCreate_Click(object sender, RoutedEventArgs e)
        {
            if (mcVersion == "1.8" || mcVersion == "1.9/1.10")
            {
                finalStr = "/summon ArmorStand ~ ~1 ~ {Tags:[\"HoloText\"],PersistenceRequired:1b,DisabledSlots:2039583,Invulnerable:1b,NoGravity:1b,Invisible:1b,CustomName:\"" + tabOther1Word.Text + "\",CustomNameVisible:true}";
            }
            else
            {
                finalStr = "/summon armor_stand ~ ~1 ~ {Tags:[\"HoloText\"],PersistenceRequired:1b,DisabledSlots:2039583,Invulnerable:1b,NoGravity:1b,Invisible:1b,CustomName:\"" + tabOther1Word.Text + "\",CustomNameVisible:true}";
            }
            //判断是否含有颜色代码
            if (finalStr.IndexOf("§", StringComparison.Ordinal) != -1)
            {
                FixColorCode fcc = new FixColorCode();
                fcc.setStr(finalStr);
                fcc.ShowDialog();
                finalStr = fcc.getStr();
            }
            Check checkbox = new Check();

            checkbox.showText(finalStr);
            checkbox.Show();
        }
        private void tabSumosCreate_Click(object sender, RoutedEventArgs e)
        {
            AllSelData asd = new AllSelData();
            string sumosText = "ArmorItems:[";
            int equipCount = 0;
            if (mcVersion == "1.8")
            {
                sumosText = "Equipment:[";
                if (sumosEquipmentMainHandId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentMainHandId) + ",Count:" + sumosEquipmentMainHandCount + "b,Damage:" + sumosEquipmentMainHandDamage + "s,tag:{" + globalSumosHand + "}},"; }
                if (sumosEquipmentBootId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentBootId) + ",Count:" + sumosEquipmentBootCount + "b,Damage:" + sumosEquipmentBootDamage + "s,tag:{" + globalSumosBoot + "}},"; } else { equipCount++; sumosText += "{},"; }
                if (sumosEquipmentLegId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentLegId) + ",Count:" + sumosEquipmentLegCount + "b,Damage:" + sumosEquipmentLegDamage + "s,tag:{" + globalSumosLeg + "}},"; } else { equipCount++; sumosText += "{},"; }
                if (sumosEquipmentChestId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentChestId) + ",Count:" + sumosEquipmentChestCount + "b,Damage:" + sumosEquipmentChestDamage + "s,tag:{" + globalSumosChest + "}},"; } else { equipCount++; sumosText += "{},"; }
                if (tabSumosHasHeadID.IsChecked.Value == false)
                {
                    if (sumosEquipmentHeadId != 0)
                    {
                        sumosText += "{id:" + asd.getItem(sumosEquipmentHeadId) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:" + sumosEquipmentHeadDamage + "s,tag:{" + globalSumosHead + "}},";
                        equipCount++;
                    }
                    else { equipCount++; sumosText += "{},"; }
                }
                else
                {
                    globalSumosTempSel = tabSumosHead.SelectedIndex;
                    sumosText += "{id:" + asd.getItem(tabSumosHead.SelectedIndex) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:3s,tag:" + tabSumosHeadID.Text + "},";
                    equipCount++;
                }
            }
            else
            {
                tabSumosEgg.IsEnabled = true;
                sumosText += "0:{"; if (sumosEquipmentBootId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentBootId) + ",Count:" + sumosEquipmentBootCount + "b,Damage:" + sumosEquipmentBootDamage + "s,tag:{" + globalSumosBoot + "}"; } sumosText += "},";
                sumosText += "1:{"; if (sumosEquipmentLegId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentLegId) + ",Count:" + sumosEquipmentLegCount + "b,Damage:" + sumosEquipmentLegDamage + "s,tag:{" + globalSumosLeg + "}"; } sumosText += "},";
                sumosText += "2:{"; if (sumosEquipmentChestId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentChestId) + ",Count:" + sumosEquipmentChestCount + "b,Damage:" + sumosEquipmentChestDamage + "s,tag:{" + globalSumosChest + "}"; } sumosText += "},";
                if (tabSumosHasHeadID.IsChecked.Value == false)
                {
                    if (sumosEquipmentHeadId != 0)
                    {
                        sumosText += "3:{id:" + asd.getItem(sumosEquipmentHeadId) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:" + sumosEquipmentHeadDamage + "s,tag:{" + globalSumosHead + "}},";
                        equipCount++;
                    }
                }
                else
                {
                    globalSumosTempSel = tabSumosHead.SelectedIndex;
                    sumosText += "3:{id:" + asd.getItem(tabSumosHead.SelectedIndex) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:3s,tag:" + tabSumosHeadID.Text + "},";
                    equipCount++;
                }
            }
            if (equipCount != 0)
            {
                sumosText = sumosText.Substring(0, sumosText.Length - 1);
                equipCount = 0;
            }
            sumosText += "],";
            sumosText = sumosText.Replace("Equipment:[{},{},{},{}],", "");
            sumosText = sumosText.Replace("Equipment:[0:{},1:{},2:{},3:{}],", "");
            if (mcVersion != "1.8")
            {
                sumosText += "HandItems:[";
                sumosText += "0:{"; if (sumosEquipmentMainHandId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentMainHandId) + ",Count:" + sumosEquipmentMainHandCount + "b,Damage:" + sumosEquipmentMainHandDamage + "s,tag:{" + globalSumosHand + "}"; } sumosText += "},";
                if (sumosEquipmentOffHandId != 0) { equipCount++; sumosText += "1:{id:" + asd.getItem(sumosEquipmentOffHandId) + ",Count:" + sumosEquipmentOffHandCount + "b,Damage:" + sumosEquipmentOffHandDamage + "s,tag:{" + globalSumosLHand + "}},"; }
                if (equipCount != 0)
                {
                    sumosText = sumosText.Substring(0, sumosText.Length - 1);
                    equipCount = 0;
                }
                sumosText += "],";
                sumosText = sumosText.Replace("ArmorItems:[0:{},1:{},2:{},]", "");
                sumosText = sumosText.Replace(",HandItems:[0:{},]", "");
                sumosText = sumosText.Replace("HandItems:[0:{},]", "");
            }
            if (tabSumosLeftHand.IsChecked.Value) sumosText += "LeftHanded:1b,";
            if (tabSumosDropchance.IsChecked.Value)
            {
                if (mcVersion == "1.8")
                {
                    sumosText += "DropChances:[" + tabSumosDCHand.Value + "F," + tabSumosDCBoot.Value + "F," + tabSumosDCLeg.Value + "F," + tabSumosDCChest.Value + "F," + tabSumosDCHead.Value + "F],";
                }
                else
                {
                    sumosText += "ArmorDropChances:[0:" + tabSumosDCBoot.Value + "F,1:" + tabSumosDCLeg.Value + "F,2:" + tabSumosDCChest.Value + "F,3:" + tabSumosDCHead.Value + "F],";
                    sumosText += "HandDropChances:[0:" + tabSumosDCHand.Value + "F,1:" + tabSumosDCLHand.Value + "F],";
                }
            }
            if (sumosText.Length != 0)
            {
                globalSumosEquipment = sumosText.Substring(0, sumosText.Length - 1).Replace(",tag:{}", "");
            }
            else
            {
                globalSumosEquipment = "";
            }
            sumosText = sumosText.Replace("{,", "{");
            if (tabSumosHasMetaData.IsChecked.Value)
            {
                sumosText += "Attributes:[" + globalAttrStringLess + "],";
            }
            if (tabSumosHasPotion.IsChecked.Value && asd.getAt(tabSumosType.SelectedIndex) != "TippedArrow" && asd.getAt(tabSumosType.SelectedIndex) != "ThrownPotion")
            {
                sumosText += "ActiveEffects:[" + globalPotionString + "],";
            }
            if (tabSumosInvulnerable.IsChecked.Value)
            {
                sumosText += "Invulnerable:1b,";
            }
            if (tabSumosHasName.IsChecked.Value)
            {
                sumosText += "CustomName:\"" + tabSumosName.Text + "\",";
                if (tabSumosNameVisible.IsChecked != null) { if (!tabSumosNameVisible.IsChecked.Value) sumosText += "CustomNameVisible:0,"; else sumosText += "CustomNameVisible:1,"; }
            }
            if (tabSumosNowHealthCheck.IsChecked.Value)
            {
                if (mcVersion == "1.8")
                {
                    sumosText += "HealF:" + tabSumosNowHealth.Value.Value + ",";
                }
                else
                {
                    sumosText += "Health:" + tabSumosNowHealth.Value.Value + "f,";
                }
            }
            if (tabSumosBaby.IsChecked.Value)
            {
                //盔甲架则为Small:1b,村民和可以自然长大的生物则Age:-2147483648,僵尸和猪人等则为IsBaby:1b
                sumosText += "IsBaby:1b,Age:-2147483648,IsBaby:1b,";
            }
            if (tabSumosSilent.IsChecked.Value)
            {
                sumosText += "Silent:1b,";
            }
            if (tabSumosNoAI.IsChecked.Value)
            {
                sumosText += "NoAI:1b,";
            }
            if (tabSumosFireCheck.IsChecked.Value)
            {
                sumosText += "Fire:" + tabSumosFireNum.Value + "s,";
            }
            if (tabSumosGlowing.IsChecked.Value)
            {
                sumosText += "Glowing:1b,";
            }
            if (tabSumosElytra.IsChecked.Value)
            {
                sumosText += "FallFlying:1b,";
            }
            if (tabSumosPersistenceRequired.IsChecked.Value)
            {
                sumosText += "PersistenceRequired:1b,";
            }
            if (tabSumosTeamCheck.IsChecked.Value)
            {
                sumosText += "Team:\"" + tabSumosTeam.Text + "\",";
            }
            if (mcVersion != "1.8")
            {
                if (tabSumosArmorNogravity.IsChecked.Value)
                {
                    sumosText += "NoGravity:1b,";
                }
            }
            if (tabSumosTagsCheck.IsChecked.Value)
            {
                string[] temp = tabSumosTags.Text.Replace("\r", "").Split('\n');
                sumosText += "Tags:[";
                for (int i = 0; i < temp.Length; i++)
                {
                    sumosText += "\"" + temp[i] + "\",";
                }
                sumosText = sumosText.Substring(0, sumosText.Length - 1);
                sumosText += "],";
            }
            if (tabSumosMotionCheck.IsChecked.Value)
            {
                int bx = tabSumosMotionX.Value.ToString().IndexOf('.');
                int by = tabSumosMotionY.Value.ToString().IndexOf('.');
                int bz = tabSumosMotionZ.Value.ToString().IndexOf('.');
                sumosText = sumosText + "Motion:[";
                if (bx == -1) sumosText += tabSumosMotionX.Value + ".0,"; else sumosText += tabSumosMotionX.Value + ",";
                if (by == -1) sumosText += tabSumosMotionY.Value + ".0,"; else sumosText += tabSumosMotionY.Value + ",";
                if (bz == -1) sumosText += tabSumosMotionZ.Value + ".0"; else sumosText += tabSumosMotionZ.Value;
                sumosText += "],";
            }
            if (tabSumosDirection.IsChecked.Value)
            {
                int bx = tabSumosDirectionX.Value.ToString().IndexOf('.');
                int by = tabSumosDirectionY.Value.ToString().IndexOf('.');
                sumosText = sumosText + "Rotation:[";
                if (by == -1) sumosText += tabSumosDirectionY.Value + ".0f,"; else sumosText += tabSumosDirectionY.Value + "f,";
                if (bx == -1) sumosText += tabSumosDirectionX.Value + ".0f,"; else sumosText += tabSumosDirectionX.Value + "f";
                sumosText += "],";
            }
            if (sumosText != null && sumosText != "") sumosText = sumosText.Substring(0, sumosText.Length - 1);
            sumosRidingSelType = asd.getAt(tabSumosType.SelectedIndex);
            //sumosRidingNBT = sumosText;
            globalSumosTypeIndex = tabSumosType.SelectedIndex;
            if (asd.getAt(tabSumosType.SelectedIndex) == "Villager" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:villager")//选择村民
            {
                if (tabVillagerMaxIndex >= globalVillagerMaxValue)
                {
                    tabVillagerMaxIndex = globalVillagerMaxValue - 1;
                }
                string summonVillager = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {Profession:" + asd.getVillagerCareerID(tabVillagerType.SelectedIndex).GetLength(0) + ",Career:" + asd.getVillagerCareerID(tabVillagerType.SelectedIndex).GetLength(1) + ",CareerLevel:9999999";
                summonVillager += "," + sumosText;//可能出现双重逗号
                summonVillager += ",Offers:{Recipes:[";
                string villagerOffers = "";
                string villagerReward = "";
                if (tabVillagerCheckCanCreate == true)
                {
                    if (tabVillagerRewardExp.IsChecked.Value)
                    {
                        villagerReward = ",rewardExp:" + tabVillagerRewardExpValue.Value + "b";
                    }
                    for (int i = 0; i <= tabVillagerMaxIndex; i++)
                    {
                        villagerOffers += "{maxUses:" + globalVillagerMaxUses[i] + villagerReward + ",buy:{id:" + asd.getItem(globalVillagerA[i]) + ",Count:" + globalVillagerACount[i] + "b,Damage:" + globalVillagerAMeta[i] + "s,tag:{" + globalVillagerAStr[i] + "}}";
                        if (globalVillagerBCheck[i] == true) villagerOffers += ",buyB:{id:" + asd.getItem(globalVillagerB[i]) + ",Count:" + globalVillagerBCount[i] + "b,Damage:" + globalVillagerBMeta[i] + "s,tag:{" + globalVillagerBStr[i] + "}}";
                        villagerOffers += ",sell:{id:" + asd.getItem(globalVillagerC[i]) + ",Count:" + globalVillagerCCount[i] + "b,Damage:" + globalVillagerCMeta[i] + "s,tag:{" + globalVillagerCStr[i] + "}}},";
                    }
                    if (villagerOffers.Length >= 1)
                    {
                        villagerOffers = villagerOffers.Remove(villagerOffers.Length - 1, 1);
                    }
                    summonVillager += villagerOffers;
                }
                else
                {
                    this.ShowMessageAsync("", SummonVAtLeastOnce, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel });
                }
                summonVillager += "]}}";
                summonVillager = summonVillager.Replace(",tag:{}", "").Replace(",,", ",");//fix double comma
                if (mcVersion == "1.8")
                {
                    summonVillager = summonVillager.Replace("splash_potion", "potion").Replace("lingering_potion", "potion");
                }
                sumosFinalStr = summonVillager;
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "ArmorStand" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:armor_stand")//盔甲架
            {
                string amtemp = "";
                if (tabSumosArmorCheck.IsChecked.Value)
                {
                    amtemp = "Pose:{Body:[" + tabSumosArmorBodyX.Value + "F," + tabSumosArmorBodyY.Value + "F," + tabSumosArmorBodyZ.Value + "F],"
                        + "LeftArm:[" + tabSumosArmorLArmX.Value + "F," + tabSumosArmorLArmY.Value + "F," + tabSumosArmorLArmZ.Value + "F],"
                        + "RightArm:[" + tabSumosArmorRArmX.Value + "F," + tabSumosArmorRArmY.Value + "F," + tabSumosArmorRArmZ.Value + "F],"
                        + "LeftLeg:[" + tabSumosArmorLLegX.Value + "F," + tabSumosArmorLLegY.Value + "F," + tabSumosArmorLLegZ.Value + "F],"
                        + "RightLeg:[" + tabSumosArmorRLegX.Value + "F," + tabSumosArmorRLegY.Value + "F," + tabSumosArmorRLegZ.Value + "F],"
                        + "Head:[" + tabSumosArmorHeadX.Value + "F," + tabSumosArmorHeadY.Value + "F," + tabSumosArmorHeadZ.Value + "F]},";
                }
                if (tabSumosArmorRotationCheck.IsChecked.Value)
                {
                    amtemp += "Rotation:[" + tabSumosArmorRotationX.Value + "F," + tabSumosArmorRotationY.Value + "F," + tabSumosArmorRotationZ.Value + "F],";
                }
                if (tabSumosArmorNochestplate.IsChecked.Value)
                {
                    amtemp += "NoBasePlate:1b,";
                }
                if (mcVersion == "1.8")
                {
                    if (tabSumosArmorNogravity.IsChecked.Value)
                    {
                        amtemp += "NoGravity:1b,";
                    }
                }
                if (tabSumosArmorCant.IsChecked.Value)
                {
                    amtemp += "DisabledSlots:2039583,";
                }
                if (tabSumosArmorShowarmor.IsChecked.Value)
                {
                    amtemp += "ShowArms:1b,";
                }
                if (tabSumosMarker.IsChecked.Value)
                {
                    amtemp += "Marker:1b,Invisible:1b,";
                }
                if (amtemp.Length > 1) { amtemp = amtemp.Substring(0, amtemp.Length - 1); }
                if (sumosText.Length > 0) { sumosText += "," + amtemp; } else { sumosText = amtemp; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "ThrownPotion" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:potion")//选择扔出的药水瓶
            {
                if (tabSumosMotionCheck.IsChecked.Value)
                {
                    string tempPotion = "";
                    int xx = tabSumosMotionX.Value.ToString().IndexOf('.');
                    int yy = tabSumosMotionY.Value.ToString().IndexOf('.');
                    int zz = tabSumosMotionZ.Value.ToString().IndexOf('.');
                    string x = "", y = "", z = "";
                    if (xx == -1) x = tabSumosMotionX.Value.ToString() + ".0"; else x = tabSumosMotionX.Value.ToString();
                    if (yy == -1) y = tabSumosMotionY.Value.ToString() + ".0"; else x = tabSumosMotionY.Value.ToString();
                    if (zz == -1) z = tabSumosMotionZ.Value.ToString() + ".0"; else x = tabSumosMotionZ.Value.ToString();
                    if (globalSumosPotion.Length >= 2)
                    {
                        tempPotion = globalSumosPotion.Remove(globalSumosPotion.Length - 1, 1);
                        sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ " + tempPotion + ",Motion:[" + x + "," + y + "," + z + "]}";
                    }
                    else
                    {
                        sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ " + "{Motion:[" + x + "," + y + "," + z + "]}";
                    }

                }
                else
                {
                    sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ " + globalSumosPotion;
                }
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "AreaEffectCloud" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:area_effect_cloud")//选择滞留药水
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                sumosText += "Effects:[" + globalPotionString + "],Duration:" + tabSumosEDuration.Value + ",Radius:" + tabSumosERadius.Value + "f,ParticleParam1:" + globalParticlePara1 + ",ParticleParam2:" + globalParticlePara2 + ",Color:" + globalParticleColor;
                if (globalParticleSel != 0) { sumosText += ",Particle:\"" + asd.getParticle(globalParticleSel) + "\""; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Chicken" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:chicken")
            {
                if (tabSumosBaby.IsChecked.Value) { if (sumosText.Length > 0) { sumosText += ",IsChickenJockey:1b"; } else { sumosText = "IsChickenJockey:1b"; } }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Enderman" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:enderman")
            {
                if (sumosEndermanCarried != -1)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",carried:\"" + asd.getItem(sumosEndermanCarried) + "\",carriedData:" + sumosEndermanCarriedMeta + "s";
                    }
                    else
                    {
                        sumosText = "carried:\"" + asd.getItem(sumosEndermanCarried) + "\",carriedData:" + sumosEndermanCarriedMeta + "s";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Ozelot" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ocelot")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",CatType:" + tabSumosECatType.Value.Value;
                }
                else
                {
                    sumosText = "CatType:" + tabSumosECatType.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Wolf" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wolf")
            {
                string temp = "";
                if (tabSumosEUUID.Text != null || tabSumosEUUID.Text != "") { if (mcVersion == "1.8") { temp = "Owner:" + tabSumosEUUID.Text; } else { temp = "OwnerUUID:" + tabSumosEUUID.Text; } }
                if (tabSumosEAngry.IsChecked.Value) { temp += ",Angry:1b"; }
                if (sumosText.Length > 0)
                {
                    sumosText += "," + temp;
                    if (tabSumosEWoolColor.SelectedIndex != -1) {sumosText += ",CollarColor:" + tabSumosEWoolColor.SelectedIndex; }
                }
                else
                {
                    sumosText += temp;
                    if (tabSumosEWoolColor.SelectedIndex != -1) { sumosText += ",CollarColor:" + tabSumosEWoolColor.SelectedIndex; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Sheep" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:sheep")
            {
                if (sumosText.Length > 0)
                {
                    if (tabSumosEWoolColor.SelectedIndex != -1) { sumosText += ",Color:" + tabSumosEWoolColor.SelectedIndex; }
                    if (tabSumosESheared.IsChecked.Value) { sumosText += ",Sheared:1b"; }
                }
                else
                {
                    if (tabSumosEWoolColor.SelectedIndex != -1) { sumosText = "Color:" + tabSumosEWoolColor.SelectedIndex; }
                    if (tabSumosESheared.IsChecked.Value) { sumosText += ",Sheared:1b"; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Creeper" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:creeper")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",ExplosionRadius:" + tabSumosEExplosionRadius.Value.Value + "b,Fuse:" + tabSumosEFuse.Value.Value + "s";
                    if (tabSumosEPowered.IsChecked.Value) { sumosText += ",powered:1b"; }
                }
                else
                {
                    sumosText = "ExplosionRadius:" + tabSumosEExplosionRadius.Value.Value + "b,Fuse:" + tabSumosEFuse.Value.Value + "s";
                    if (tabSumosEPowered.IsChecked.Value) { sumosText += ",powered:1b"; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Slime" || asd.getAt(tabSumosType.SelectedIndex) == "LavaSlime" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:slime" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:magma_cube")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",Size:" + tabSumosESize.Value.Value;
                }
                else
                {
                    sumosText = "Size:" + tabSumosESize.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Shulker" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:shulker")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",Peek:" + tabSumosEShulkerPeek.Value.Value + "b";
                }
                else
                {
                    sumosText = "Peek:" + tabSumosEShulkerPeek.Value.Value + "b";
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "EnderDragon" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ender_dragon")
            {
                if (tabSumosEDragon.Value.Value != -1)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",DragonPhase:" + tabSumosEDragon.Value.Value;
                    }
                    else
                    {
                        sumosText = "DragonPhase:" + tabSumosEDragon.Value.Value;
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Ghast" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ghast")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",ExplosionPower:" + tabSumosEExplosionPower.Value.Value;
                }
                else
                {
                    sumosText = "ExplosionPower:" + tabSumosEExplosionPower.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Rabbit" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:rabbit")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",RabbitType:" + tabSumosERabbitType.Value.Value;
                }
                else
                {
                    sumosText = "RabbitType:" + tabSumosERabbitType.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "WitherBoss" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wither")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",Invul:" + tabSumosEInvul.Value.Value;
                }
                else
                {
                    sumosText = "Invul:" + tabSumosEInvul.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Endermite" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:endermite")
            {
                if (tabSumosEAtkByEnderman.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",PlayerSpawned:1b";
                    }
                    else
                    {
                        sumosText = "PlayerSpawned:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Zombie" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie")
            {
                if (tabSumosECanBreakDoor.IsChecked.Value) { sumosText += ",CanBreakDoors:1b"; }
                if (tabSumosEZombieType.Value.Value != -1) { sumosText += ",ZombieType:" + tabSumosEZombieType.Value.Value; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "PigZombie" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_pigman")
            {
                if (tabSumosECanBreakDoor.IsChecked.Value) { sumosText += ",CanBreakDoors:1b"; }
                if (tabSumosEZombieType.Value.Value != -1) { sumosText += ",ZombieType:" + tabSumosEZombieType.Value.Value; }
                if (tabSumosEAngry.IsChecked.Value) { sumosText += ",Anger:32767s"; }
                if (tabSumosEUUID.Text != "") { sumosText += ",HurtBy:" + tabSumosEUUID.Text; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "VillagerGolem" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:villager_golem")
            {
                if (tabSumosEPlayerCreated.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",PlayerCreated:1b";
                    }
                    else
                    {
                        sumosText = "PlayerCreated:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Pig" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:pig")
            {
                if (tabSumosESaddle.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",Saddle:1b";
                    }
                    else
                    {
                        sumosText = "Saddle:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Skeleton" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:skeleton")
            {
                if (sumosText.Length > 0)
                {
                    if (tabSumosEZombieType.Value.Value != -1) { sumosText += ",SkeletonType:" + tabSumosEZombieType.Value.Value; }
                }
                else
                {
                    if (tabSumosEZombieType.Value.Value != -1) { sumosText += "SkeletonType:" + tabSumosEZombieType.Value.Value; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Guardian" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:guardian")
            {
                if (tabSumosEElder.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",Elder:1b";
                    }
                    else
                    {
                        sumosText = "Elder:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "EntityHorse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:horse")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                if (mcVersion != "latest") if (HorseTypeDonkey.IsChecked.Value) { sumosText += "Type:1"; } else if (HorseTypeMule.IsChecked.Value) { sumosText += "Type:2"; } else if (HorseTypeZombie.IsChecked.Value) { sumosText += "Type:3"; } else if (HorseTypeSkeleton.IsChecked.Value) { sumosText += "Type:4"; } else { sumosText += "Type:0"; }
                sumosText += ",Variant:" + HorseVariantValue.Value.Value;
                if (HorseTypeDonkey.IsChecked.Value || HorseTypeMule.IsChecked.Value) { sumosText += ",ChestedHorse:1b"; }
                if (HorseTamed.IsChecked.Value) { sumosText += ",Tame:1b"; if (HorseTamedUUID.Text != null || HorseTamedUUID.Text != "") { if (mcVersion == "1.8") { sumosText += ",OwnerName:" + HorseTamedUUID.Text; } else { sumosText += ",OwnerUUID:" + HorseTamedUUID.Text; } } }
                if (mcVersion != "latest") if (HorseSaddle.IsChecked.Value) { sumosText += ",Saddle:1b"; }
                if (HorseSkeletonTrap.IsChecked.Value) { sumosText += ",SkeletonTrap:1b,SkeletonTrapTime:" + HorseSkeletonTrapTime.Value.Value; }
                sumosText += ",Items:[";
                if (HorseChestList[0] != null && HorseChestList[0] != "") { sumosText += HorseChestList[0] + ","; }
                if (HorseChestList[1] != null && HorseChestList[1] != "") { sumosText += HorseChestList[1] + ","; }
                if (HorseChestList[2] != null && HorseChestList[2] != "") { sumosText += HorseChestList[2] + ","; }
                if (HorseChestList[3] != null && HorseChestList[3] != "") { sumosText += HorseChestList[3] + ","; }
                if (HorseChestList[4] != null && HorseChestList[4] != "") { sumosText += HorseChestList[4] + ","; }
                if (HorseChestList[5] != null && HorseChestList[5] != "") { sumosText += HorseChestList[5] + ","; }
                if (HorseChestList[6] != null && HorseChestList[6] != "") { sumosText += HorseChestList[6] + ","; }
                if (HorseChestList[7] != null && HorseChestList[7] != "") { sumosText += HorseChestList[7] + ","; }
                if (HorseChestList[8] != null && HorseChestList[8] != "") { sumosText += HorseChestList[8] + ","; }
                if (HorseChestList[9] != null && HorseChestList[9] != "") { sumosText += HorseChestList[9] + ","; }
                if (HorseChestList[10] != null && HorseChestList[10] != "") { sumosText += HorseChestList[10] + ","; }
                if (HorseChestList[11] != null && HorseChestList[11] != "") { sumosText += HorseChestList[11] + ","; }
                if (HorseChestList[12] != null && HorseChestList[12] != "") { sumosText += HorseChestList[12] + ","; }
                if (HorseChestList[13] != null && HorseChestList[13] != "") { sumosText += HorseChestList[13] + ","; }
                if (HorseChestList[14] != null && HorseChestList[14] != "") { sumosText += HorseChestList[14] + ","; }
                sumosText += "]";
                if (HorseChestList[15] != null && HorseChestList[15] != "") { sumosText += ",SaddleItem:" + HorseChestList[15] + ","; }
                if (HorseChestList[16] != null && HorseChestList[16] != "") { sumosText += ",ArmorItem:" + HorseChestList[16] + ","; }
                sumosText = sumosText.Replace(",,", ",");
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "TippedArrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:arrow")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                if (tabSumosHasPotion.IsChecked.Value)
                {
                    sumosText += "CustomPotionEffects:[" + globalPotionString + "]";
                }
                if (sumosText.Length > 0) { sumosText += ",pickup:" + tabSumosEpickup.Value.Value + "b"; } else { sumosText += "pickup:" + tabSumosEpickup.Value.Value + "b"; }
                if (sumosText.Length > 0) { sumosText += ",damage:" + tabSumosEdamage.Value.Value + "d"; } else { sumosText += "damage:" + tabSumosEdamage.Value.Value + "d"; }
                sumosFinalStr = "/summon Arrow ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "SpectralArrow" || asd.getAt(tabSumosType.SelectedIndex) == "Arrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:spectral_arrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:arrow")
            {
                if (sumosText.Length > 0) { sumosText += ",pickup:" + tabSumosEpickup.Value.Value + "b"; } else { sumosText += "pickup:" + tabSumosEpickup.Value.Value + "b"; }
                if (sumosText.Length > 0) { sumosText += ",damage:" + tabSumosEdamage.Value.Value + "d"; } else { sumosText += "damage:" + tabSumosEdamage.Value.Value + "d"; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Fireball" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:fireball")
            {
                if (sumosText.Length > 0) { sumosText += ",ExplosionPower:" + tabSumosEExplosionPower.Value.Value; } else { sumosText += "ExplosionPower:" + tabSumosEExplosionPower.Value.Value; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Snowball" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownEgg" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownEnderpearl" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownExpBottle" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:snowball" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:egg" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ender_pearl" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:xp_bottle")
            {
                if (tabSumosEUUID.Text != "")
                {
                    if (sumosText.Length > 0) { sumosText += ","; }
                    sumosText += "ownerName:" + tabSumosEUUID.Text;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Item" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item")
            {
                if (tabSummonItem.SelectedIndex == 0)
                {
                    summonFinalStr = SummonSNotChooseItemType;
                }
                else
                {
                    string summonText = "";
                    if (tabSummonPickupdelayCheck.IsChecked.Value)
                    {
                        summonText += "PickupDelay:" + tabSummonPickupdelay.Value + ",";
                    }
                    if (tabSummonAgeCheck.IsChecked.Value)
                    {
                        summonText += "Age:" + tabSummonAge.Value + ",";
                    }
                    summonText += "Item:{id:\"" + asd.getItem(tabSummonItem.SelectedIndex) + "\",Count:" + tabSummonCount.Value + "b,Damage:" + tabSummonMeta.Value + "s";
                    summonText += ",tag:{";
                    if (tabSummonHide.SelectedIndex != 0)
                    {
                        summonText += "HideFlags: " + tabSummonHide.SelectedIndex + ",";
                    }
                    if (tabSummonUnbreaking.IsChecked.Value)
                    {
                        summonText += "Unbreakable:1,";
                    }
                    if (tabSummonHasEnchant.IsChecked.Value || tabSummonHasNL.IsChecked.Value || tabSummonHasAttr.IsChecked.Value)
                    {
                        string meta = tabSummonGetBackMeta();
                        summonText += meta + ",";
                    }
                    summonText += "}}";
                    summonText = summonText.Replace(",tag:{,}", "");
                    if (tabSumosEOwner.Text != "") { summonText += ",Owner:" + tabSumosEOwner.Text; }
                    if (tabSumosEThrower.Text != "") { summonText += ",Thrower:" + tabSumosEThrower.Text; }
                    //ridingText = ",Riding:{id:\"" + asd.getItem(tabSummonItem.SelectedIndex) + "\",Count:" + tabSummonCount.Value + "b,Damage:" + tabSummonMeta.Value + "s";
                    sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + summonText + "}";
                }
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "XPOrb" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:xp_orb")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                sumosText += "Value:" + tabSumosEExp.Value.Value + "s";
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "PrimedTnt" || asd.getAt(tabSumosType.SelectedIndex) == "MinecartTNT" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:tnt_minecart")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                sumosText += "Fuse:" + tabSumosEFuse.Value.Value;
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "FallingSand" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:falling_block")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                string sands = "";
                if (asd.getItem(FallingSandItemSel.SelectedIndex) != "minecraft:sand") sands += "Block:\"" + asd.getItem(FallingSandItemSel.SelectedIndex) + "\",";
                if (FallingSandMeta.Value.Value != 0) sands += "Data:" + FallingSandMeta.Value.Value + "s,";
                sands += "Time:" + FallingSandLifeTime.Value.Value + ",";
                if (!FallingSandIsDrop.IsChecked.Value) sands += "DropItem:0b,";
                if (FallingSandIsDamage.IsChecked.Value) { sands += "HurtEntities:1b,FallHurtMax:" + FallingSandMaxDamage.Value.Value + ",FallHurtAmount:" + FallingSandDamageCount.Value.Value + "f,"; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + sands.Substring(0, sands.Length - 1) + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "ItemFrame" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item_frame")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                string frame = "ItemDropChance:" + FrameDropChance.Value.Value + "f,ItemRotation:" + FrameRouteCount.Value.Value + "b,";
                if (FrameCoCheck.IsChecked.Value) { frame += "TileX:" + FrameX.Value.Value + ",TileY:" + FrameY.Value.Value + ",TileZ:" + FrameZ.Value.Value + ","; }
                if (FrameFacing.Value.Value != -1) { frame += "Facing:" + FrameFacing.Value.Value + "b,"; }
                if (FrameHasItem.IsChecked.Value) { frame += "Item:{Count:" + globalFrameItem[0] + "b,Damage:" + globalFrameItem[1] + "s,id:\"" + globalFrameItem[2] + "\",tag:{" + globalFrameItem[3] + "}},"; } else { frame += "Item:{},"; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + frame.Substring(0, frame.Length - 1) + "}";
            }
            else
            {
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            sumosFinalStr = sumosFinalStr.Replace(",tag:{}", "").Replace("{,", "{").Replace(" {}", "");
            if (sumosFinalStr.IndexOf("{") == -1)
            {
                sumosRidingNBT = sumosText;
            }
            else
            {
                sumosRidingNBT = sumosFinalStr.Substring(sumosFinalStr.IndexOf("{") + 1, sumosFinalStr.Length - sumosFinalStr.IndexOf("{") - 2);
            }
            //我也不知道为什么要写这么复杂
            //判断是否含有颜色代码
            if (sumosFinalStr.IndexOf("§") != -1)
            {
                FixColorCode fcc = new FixColorCode();
                fcc.setStr(sumosFinalStr);
                fcc.ShowDialog();
                sumosFinalStr = fcc.getStr();
            }
        }
 private void createBtn_Click(object sender, RoutedEventArgs e)
 {
     globalPotionCount = tabPotionNum.Value.Value.ToString();
     string endStr = "";
     if (mcVersion == "1.8")
     {
         if (tabPotionA.IsChecked.Value)
         {
             endStr = "/give " + at + " minecraft:potion " + tabPotionNum.Value.ToString() + " 0";
             globalPotionID = "minecraft:potion";
             globalPotionYN = 0;
         }
         else if (tabPotionB.IsChecked.Value)
         {
             endStr = "/give " + at + " minecraft:potion " + tabPotionNum.Value.ToString() + " 16384";
             globalPotionID = "minecraft:splash_potion";
             globalPotionYN = 16384;
         }
         else if (tabPotionBUFFPotion.IsChecked.Value) { endStr = PotionNotSelect; globalPotionID = "minecraft:splash_potion"; }
         else if (tabPotionTipArrow.IsChecked.Value) { endStr = PotionNotSelect; globalPotionID = "minecraft:splash_potion"; }
         else { endStr = PotionNotSelect; }
     }
     else
     {
         if (tabPotionA.IsChecked.Value)
         {
             endStr = "/give " + at + " minecraft:potion " + tabPotionNum.Value.ToString() + " 0";
             globalPotionID = "minecraft:potion";
         }
         else if (tabPotionB.IsChecked.Value)
         {
             endStr = "/give " + at + " minecraft:splash_potion " + tabPotionNum.Value.ToString() + " 0";
             globalPotionID = "minecraft:splash_potion";
         }
         else if (tabPotionBUFFPotion.IsChecked.Value)
         {
             endStr = "/give " + at + " minecraft:lingering_potion " + tabPotionNum.Value.ToString() + " 0";
             globalPotionID = "minecraft:lingering_potion";
         }
         else if (tabPotionTipArrow.IsChecked.Value)
         {
             endStr = "/give " + at + " minecraft:tipped_arrow " + tabPotionNum.Value.ToString() + " 0";
             globalPotionID = "minecraft:tipped_arrow";
         }
         else
         {
             endStr = PotionNotSelect;
         }
     }
     string nbt = "";
     if (PotionItemColor.IsChecked.Value)
     {
         nbt += "CustomPotionColor:" + tabPotionColor.Value.Value + ",";
     }
     if (tabPotionHasEnchant.IsChecked.Value)
     {
         nbt += globalEnchString + ",";
     }
     if (tabPotionHasNL.IsChecked.Value)
     {
         nbt += globalNLString + ",";
     }
     if (tabPotionHasAttr.IsChecked.Value)
     {
         nbt += globalAttrString + ",";
     }
     if (globalHideflag != "")
     {
         nbt += globalHideflag + ",";
     }
     if (PotionItemColor.IsChecked.Value || tabPotionHasEnchant.IsChecked.Value || tabPotionHasNL.IsChecked.Value || tabPotionHasAttr.IsChecked.Value || globalHideflag != "")
     {
         nbt = nbt.Remove(nbt.Length - 1, 1);
     }
     string format = "";
     if (tabPotionEffect1.IsChecked.Value) { format += "{Id:1,Amplifier:" + (tabPotionEffect1Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect1Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect1H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect2.IsChecked.Value) { format += "{Id:2,Amplifier:" + (tabPotionEffect2Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect2Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect2H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect3.IsChecked.Value) { format += "{Id:3,Amplifier:" + (tabPotionEffect3Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect3Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect3H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect4.IsChecked.Value) { format += "{Id:4,Amplifier:" + (tabPotionEffect4Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect4Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect4H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect5.IsChecked.Value) { format += "{Id:5,Amplifier:" + (tabPotionEffect5Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect5Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect5H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect6.IsChecked.Value) { format += "{Id:6,Amplifier:" + (tabPotionEffect6Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect6Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect6H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect7.IsChecked.Value) { format += "{Id:7,Amplifier:" + (tabPotionEffect7Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect7Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect7H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect8.IsChecked.Value) { format += "{Id:8,Amplifier:" + (tabPotionEffect8Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect8Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect8H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect9.IsChecked.Value) { format += "{Id:9,Amplifier:" + (tabPotionEffect9Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect9Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect9H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect10.IsChecked.Value) { format += "{Id:10,Amplifier:" + (tabPotionEffect10Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect10Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect10H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect11.IsChecked.Value) { format += "{Id:11,Amplifier:" + (tabPotionEffect11Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect11Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect11H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect12.IsChecked.Value) { format += "{Id:12,Amplifier:" + (tabPotionEffect12Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect12Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect12H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect13.IsChecked.Value) { format += "{Id:13,Amplifier:" + (tabPotionEffect13Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect13Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect13H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect14.IsChecked.Value) { format += "{Id:14,Amplifier:" + (tabPotionEffect14Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect14Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect14H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect15.IsChecked.Value) { format += "{Id:15,Amplifier:" + (tabPotionEffect15Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect15Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect15H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect16.IsChecked.Value) { format += "{Id:16,Amplifier:" + (tabPotionEffect16Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect16Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect16H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect17.IsChecked.Value) { format += "{Id:17,Amplifier:" + (tabPotionEffect17Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect17Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect17H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect18.IsChecked.Value) { format += "{Id:18,Amplifier:" + (tabPotionEffect18Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect18Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect18H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect19.IsChecked.Value) { format += "{Id:19,Amplifier:" + (tabPotionEffect19Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect19Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect19H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect20.IsChecked.Value) { format += "{Id:20,Amplifier:" + (tabPotionEffect20Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect20Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect20H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect21.IsChecked.Value) { format += "{Id:21,Amplifier:" + (tabPotionEffect21Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect21Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect21H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect22.IsChecked.Value) { format += "{Id:22,Amplifier:" + (tabPotionEffect22Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect22Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect22H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect23.IsChecked.Value) { format += "{Id:23,Amplifier:" + (tabPotionEffect23Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect23Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect23H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect24.IsChecked.Value) { format += "{Id:24,Amplifier:" + (tabPotionEffect24Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect24Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect24H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect25.IsChecked.Value) { format += "{Id:25,Amplifier:" + (tabPotionEffect25Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect25Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect25H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect26.IsChecked.Value) { format += "{Id:26,Amplifier:" + (tabPotionEffect26Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect26Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect26H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (tabPotionEffect27.IsChecked.Value) { format += "{Id:27,Amplifier:" + (tabPotionEffect27Level.Value - 1).ToString() + ",Duration:" + tabPotionEffect27Time.Value; if (tabPotionAllHideParticles.IsChecked.Value || tabPotionEffect27H.IsChecked.Value) { format += ",ShowParticles:0b},"; } else { format += "},"; } }
     if (format.Length >= 1)
     {
         format = format.Remove(format.Length - 1, 1);
     }
     globalPotionString = format;
     if (PotionItemColor.IsChecked.Value || tabPotionHasEnchant.IsChecked.Value || tabPotionHasNL.IsChecked.Value || tabPotionHasAttr.IsChecked.Value)
     {
         endStr += " {CustomPotionEffects:[" + format + "]," + nbt + "}";
     }
     else
     {
         endStr += " {CustomPotionEffects:[" + format + "]}";
     }
     globalPotionNBT = nbt;
     finalStr = endStr;
     //判断是否含有颜色代码
     if (finalStr.IndexOf("§") != -1)
     {
         FixColorCode fcc = new FixColorCode();
         fcc.setStr(finalStr);
         fcc.ShowDialog();
         finalStr = fcc.getStr();
     }
 }
 private void showFixColorWindow()
 {
     FixColorCode fcc = new FixColorCode();
     fcc.setStr(finalStr);
     fcc.ShowDialog();
     finalStr = fcc.getStr();
 }
 private void bCreate_Click(object sender, RoutedEventArgs e)
 {
     string fir = "";
     string sec = "";
     if (South.IsChecked.Value)
     {
         fir = "/testforblock ~ ~-1 ~-3 dropper 2";
         sec = "/blockdata ~ ~-1 ~-5";
     }
     else if (North.IsChecked.Value)
     {
         fir = "/testforblock ~ ~-1 ~3 dropper 3";
         sec = "/blockdata ~ ~-1 ~5";
     }
     else if (East.IsChecked.Value)
     {
         fir = "/testforblock ~-3 ~-1 ~ dropper 4";
         sec = "/blockdata ~-5 ~-1 ~";
     }
     else if (West.IsChecked.Value)
     {
         fir = "/testforblock ~3 ~-1 ~ dropper 5";
         sec = "/blockdata ~5 ~-1 ~";
     }
     string firstBlock = "";
     if (CustomNameCheck.IsChecked.Value) { firstBlock += " {CustomName:\"" + CustomNameBox.Text + "\",Items:["; }
         else { firstBlock += " {Items:["; }
     if (item1 != "") firstBlock += item1 + ",";
     if (item2 != "") firstBlock += item2 + ",";
     if (item3 != "") firstBlock += item3 + ",";
     if (item4 != "") firstBlock += item4 + ",";
     if (item5 != "") firstBlock += item5 + ",";
     if (item6 != "") firstBlock += item6 + ",";
     if (item7 != "") firstBlock += item7 + ",";
     if (item8 != "") firstBlock += item8 + ",";
     if (item9 != "") firstBlock += item9 + ",";
     if (firstBlock != " {Items:[") firstBlock = firstBlock.Remove(firstBlock.Count() - 1, 1);
     string secondBlock = "";
     if (CustomNameCheck.IsChecked.Value) { secondBlock += " {CustomName:\"" + CustomNameBox_Copy.Text + "\",Items:["; }
         else { secondBlock += " {Items:["; }
     if (item1_Copy != "") secondBlock += item1_Copy + ",";
     if (item2_Copy != "") secondBlock += item2_Copy + ",";
     if (item3_Copy != "") secondBlock += item3_Copy + ",";
     if (item4_Copy != "") secondBlock += item4_Copy + ",";
     if (item5_Copy != "") secondBlock += item5_Copy + ",";
     if (item6_Copy != "") secondBlock += item6_Copy + ",";
     if (item7_Copy != "") secondBlock += item7_Copy + ",";
     if (item8_Copy != "") secondBlock += item8_Copy + ",";
     if (item9_Copy != "") secondBlock += item9_Copy + ",";
     if (secondBlock != " {Items:[") secondBlock = secondBlock.Remove(secondBlock.Count() - 1, 1);
     firstBlock = fir + firstBlock + "]}";
     secondBlock = sec + secondBlock + "]}";
     //判断是否含有颜色代码
     if (firstBlock.IndexOf("§") != -1)
     {
         FixColorCode fcc = new FixColorCode();
         fcc.setStr(firstBlock);
         fcc.fixColor();
         firstBlock = fcc.getStr();
         fcc.Close();
     }
     if (secondBlock.IndexOf("§") != -1)
     {
         FixColorCode fcc = new FixColorCode();
         fcc.setStr(secondBlock);
         fcc.fixColor();
         secondBlock = fcc.getStr();
         fcc.Close();
     }
     Check cbox2 = new Check();
     cbox2.showText(secondBlock, CCBack);
     cbox2.Show();
     Check cbox = new Check();
     cbox.showText(firstBlock, CCFront);
     cbox.Show();
 }
        private void bCreate_Click(object sender, RoutedEventArgs e)
        {
            string fir = "";
            string sec = "";

            if (South.IsChecked.Value)
            {
                fir = "/testforblock ~ ~-1 ~-3 dropper 2";
                sec = "/blockdata ~ ~-1 ~-5";
            }
            else if (North.IsChecked.Value)
            {
                fir = "/testforblock ~ ~-1 ~3 dropper 3";
                sec = "/blockdata ~ ~-1 ~5";
            }
            else if (East.IsChecked.Value)
            {
                fir = "/testforblock ~-3 ~-1 ~ dropper 4";
                sec = "/blockdata ~-5 ~-1 ~";
            }
            else if (West.IsChecked.Value)
            {
                fir = "/testforblock ~3 ~-1 ~ dropper 5";
                sec = "/blockdata ~5 ~-1 ~";
            }
            string firstBlock = "";

            if (CustomNameCheck.IsChecked.Value)
            {
                firstBlock += " {CustomName:\"" + CustomNameBox.Text + "\",Items:[";
            }
            else
            {
                firstBlock += " {Items:[";
            }
            if (item1 != "")
            {
                firstBlock += item1 + ",";
            }
            if (item2 != "")
            {
                firstBlock += item2 + ",";
            }
            if (item3 != "")
            {
                firstBlock += item3 + ",";
            }
            if (item4 != "")
            {
                firstBlock += item4 + ",";
            }
            if (item5 != "")
            {
                firstBlock += item5 + ",";
            }
            if (item6 != "")
            {
                firstBlock += item6 + ",";
            }
            if (item7 != "")
            {
                firstBlock += item7 + ",";
            }
            if (item8 != "")
            {
                firstBlock += item8 + ",";
            }
            if (item9 != "")
            {
                firstBlock += item9 + ",";
            }
            if (firstBlock != " {Items:[")
            {
                firstBlock = firstBlock.Remove(firstBlock.Count() - 1, 1);
            }
            string secondBlock = "";

            if (CustomNameCheck.IsChecked.Value)
            {
                secondBlock += " {CustomName:\"" + CustomNameBox_Copy.Text + "\",Items:[";
            }
            else
            {
                secondBlock += " {Items:[";
            }
            if (item1_Copy != "")
            {
                secondBlock += item1_Copy + ",";
            }
            if (item2_Copy != "")
            {
                secondBlock += item2_Copy + ",";
            }
            if (item3_Copy != "")
            {
                secondBlock += item3_Copy + ",";
            }
            if (item4_Copy != "")
            {
                secondBlock += item4_Copy + ",";
            }
            if (item5_Copy != "")
            {
                secondBlock += item5_Copy + ",";
            }
            if (item6_Copy != "")
            {
                secondBlock += item6_Copy + ",";
            }
            if (item7_Copy != "")
            {
                secondBlock += item7_Copy + ",";
            }
            if (item8_Copy != "")
            {
                secondBlock += item8_Copy + ",";
            }
            if (item9_Copy != "")
            {
                secondBlock += item9_Copy + ",";
            }
            if (secondBlock != " {Items:[")
            {
                secondBlock = secondBlock.Remove(secondBlock.Count() - 1, 1);
            }
            firstBlock  = fir + firstBlock + "]}";
            secondBlock = sec + secondBlock + "]}";
            //判断是否含有颜色代码
            if (firstBlock.IndexOf("§") != -1)
            {
                FixColorCode fcc = new FixColorCode();
                fcc.setStr(firstBlock);
                fcc.fixColor();
                firstBlock = fcc.getStr();
                fcc.Close();
            }
            if (secondBlock.IndexOf("§") != -1)
            {
                FixColorCode fcc = new FixColorCode();
                fcc.setStr(secondBlock);
                fcc.fixColor();
                secondBlock = fcc.getStr();
                fcc.Close();
            }
            Check cbox2 = new Check();

            cbox2.showText(secondBlock, CCBack);
            cbox2.Show();
            Check cbox = new Check();

            cbox.showText(firstBlock, CCFront);
            cbox.Show();
        }