private void createBtn_Click(object sender, RoutedEventArgs e)
 {
     if (rbTestfor.IsChecked.Value)
     {
         finalStr = "/testfor " + at;
     }
     else
     {
         finalStr = "/execute " + at + " ~" + x.Value.Value + " ~" + y.Value.Value + " ~" + z.Value.Value + " ";
         if (executeCmd.Text.Substring(0, 1) == "/")
         {
             executeCmd.Text = executeCmd.Text.Substring(1, executeCmd.Text.Length - 1);
         }
         if (detectCheck.IsChecked.Value)
         {
             AllSelData asd = new AllSelData();
             finalStr += "detect ~" + x2.Value.Value + " ~" + y2.Value.Value + " ~" + z2.Value.Value + " " + asd.getItem(itemSel.SelectedIndex) + " " + blockData.Value.Value + " " + executeCmd.Text;
         }
         else
         {
             finalStr += executeCmd.Text;
         }
         finalStr = finalStr.Replace("~0", "~");
     }
 }
Пример #2
0
        private void tabOther1ItemFlyCreate_Click(object sender, RoutedEventArgs e)
        {
            if (tabOther1ItemFlySel.SelectedIndex < 0)
            {
                tabOther1ItemFlySel.SelectedIndex = 0;
            }
            string canget = "";

            if (tabOther1ItemFlyCantGet.IsChecked.Value)
            {
                canget = "32767";
            }
            else
            {
                canget = "0";
            }
            AllSelData asd = new AllSelData();

            if (mcVersion == "1.8" || mcVersion == "1.9/1.10")
            {
                finalStr = "/summon ArmorStand ~ ~1 ~ {Tags:[\"HoloItems\"],PersistenceRequired:1b,DisabledSlots:2039583,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Passengers:[{id:Item,Tags:[\"HoloItems\"],Item:{id:\"" + asd.getItem(tabOther1ItemFlySel.SelectedIndex) + "\",Count:" + tabOther1ItemFlyCount.Value + "b,Damage:" + tabOther1ItemFlyDamage.Value + "s},PickupDelay:" + canget + ",Age:-32768}]}";
            }
            else
            {
                finalStr = "/summon armor_stand ~ ~1 ~ {Tags:[\"HoloItems\"],PersistenceRequired:1b,DisabledSlots:2039583,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Passengers:[{id:Item,Tags:[\"HoloItems\"],Item:{id:\"" + asd.getItem(tabOther1ItemFlySel.SelectedIndex) + "\",Count:" + tabOther1ItemFlyCount.Value + "b,Damage:" + tabOther1ItemFlyDamage.Value + "s},PickupDelay:" + canget + ",Age:-32768}]}";
            }
            Check checkbox = new Check();

            checkbox.showText(finalStr);
            checkbox.Show();
        }
        public CustomCraft()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                cb1.Items.Add(asd.getItemNameList(i));
                cb2.Items.Add(asd.getItemNameList(i));
                cb3.Items.Add(asd.getItemNameList(i));
                cb4.Items.Add(asd.getItemNameList(i));
                cb5.Items.Add(asd.getItemNameList(i));
                cb6.Items.Add(asd.getItemNameList(i));
                cb7.Items.Add(asd.getItemNameList(i));
                cb8.Items.Add(asd.getItemNameList(i));
                cb9.Items.Add(asd.getItemNameList(i));
                cb1_Copy.Items.Add(asd.getItemNameList(i));
                cb2_Copy.Items.Add(asd.getItemNameList(i));
                cb3_Copy.Items.Add(asd.getItemNameList(i));
                cb4_Copy.Items.Add(asd.getItemNameList(i));
                cb5_Copy.Items.Add(asd.getItemNameList(i));
                cb6_Copy.Items.Add(asd.getItemNameList(i));
                cb7_Copy.Items.Add(asd.getItemNameList(i));
                cb8_Copy.Items.Add(asd.getItemNameList(i));
                cb9_Copy.Items.Add(asd.getItemNameList(i));
            }
            for (int i = 0; i < asd.getUniColorStrCount(); i++)
            {
                CustomNameColor.Items.Add(asd.getUniColorStr(i));
                CustomNameColor_Copy.Items.Add(asd.getUniColorStr(i));
            }
        }
        private void createBtn_Click(object sender, RoutedEventArgs e)
        {
            int level = (int)tabEffectLevel.Value.Value - 1;

            if (tabEffectSel.SelectedIndex < 0)
            {
                tabEffectSel.SelectedIndex = 0;
            }
            string andAt = "/effect " + at + " ";

            if (tabEffectSel.SelectedIndex == 1)
            {
                andAt += "clear";
            }
            else if (tabEffectSel.SelectedIndex == 0)
            {
                this.ShowMessageAsync(FloatErrorTitle, EffectChooseEffect, MessageDialogStyle.Affirmative, new MetroDialogSettings()
                {
                    AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel
                });
            }
            else
            {
                AllSelData asd = new AllSelData();
                if (tabEffectSelID.IsChecked.Value == true)
                {
                    if (tabEffectHide.IsChecked.Value == true)
                    {
                        andAt += asd.getEffect(tabEffectSel.SelectedIndex, true) + " " + tabEffectTime.Value + " " + level + " true";
                    }
                    else
                    {
                        andAt += asd.getEffect(tabEffectSel.SelectedIndex, true) + " " + tabEffectTime.Value + " " + level;
                    }
                }
                else if (tabEffectSelName.IsChecked.Value == true)
                {
                    if (tabEffectHide.IsChecked.Value == true)
                    {
                        andAt += asd.getEffect(tabEffectSel.SelectedIndex, false) + " " + tabEffectTime.Value + " " + level + " true";
                    }
                    else
                    {
                        andAt += asd.getEffect(tabEffectSel.SelectedIndex, false) + " " + tabEffectTime.Value + " " + level;
                    }
                }
                else
                {
                    this.ShowMessageAsync(FloatErrorTitle, EffectNotChooseError, MessageDialogStyle.Affirmative, new MetroDialogSettings()
                    {
                        AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel
                    });
                }
            }
            tabEffectBitmapDraw();
            finalStr = andAt;
        }
        public Testfor()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                itemSel.Items.Add(asd.getItemNameList(i));
            }
            clear();
        }
        public AdventureMode()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                tabRPGOnlyBrokeSel.Items.Add(asd.getItemNameList(i));
                tabRPGOnlyPlaceSel.Items.Add(asd.getItemNameList(i));
            }
            clear();
        }
Пример #7
0
        private void listFlush()
        {
            pageList.Items.Clear();
            AllSelData asd = new AllSelData();

            for (int i = 0; i <= tabBannerMaxIndex; i++)
            {
                if (i < globalBannerMaxIndex)
                {
                    int ii = i + 1;
                    pageList.Items.Add("[" + ii + "] " + asd.getBannerColorStr(globalBannerColor[i]) + asd.getBannerTypeStr(globalBannerType[i]));
                }
            }
        }
Пример #8
0
        private void listFlush()
        {
            pageList.Items.Clear();
            AllSelData asd = new AllSelData();

            for (int i = 0; i <= SFMaxIndex; i++)
            {
                if (i < globalSFMaxIndex)
                {
                    int ii = i + 1;
                    pageList.Items.Add("[" + ii + "] " + globalSFBlockCount[i] + "x" + asd.getItemNameList(globalSFBlockID[i]));
                }
            }
        }
Пример #9
0
        private void tabOther1HatCreate_Click(object sender, RoutedEventArgs e)
        {
            if (tabOther1HatSel.SelectedIndex < 0)
            {
                tabOther1HatSel.SelectedIndex = 0;
            }
            string nbt = "{";

            if (globalEnchString != "")
            {
                nbt += globalEnchString + ",";
            }
            if (globalNLString != "")
            {
                nbt += globalNLString + ",";
            }
            if (globalAttrString != "")
            {
                nbt += globalAttrString + ",";
            }
            if (globalHideflag != "")
            {
                nbt += globalHideflag + ",";
            }
            if (globalEnchString != "" || globalNLString != "" || globalAttrString != "" || globalHideflag != "")
            {
                if (nbt.Length >= 1)
                {
                    nbt = nbt.Remove(nbt.Length - 1, 1);
                }
                else
                {
                    //errorC = true;
                }
            }
            nbt += "}";
            AllSelData asd  = new AllSelData();
            string     temp = "/replaceitem entity @e[type=Player,c=1] slot.armor.head " + asd.getItem(tabOther1HatSel.SelectedIndex) + " " + tabOther1HatNum.Value + " " + tabOther1HatDamage.Value;

            if (tabOther1HatNBT.IsChecked.Value)
            {
                temp = temp + " " + nbt;
            }
            finalStr = temp;
            Check checkbox = new Check();

            checkbox.showText(finalStr);
            checkbox.Show();
        }
        private void placeFlush()
        {
            placeList.Items.Clear();
            placeList.Items.Add(AdvCanPlace);
            AllSelData asd = new AllSelData();

            for (int i = 0; i <= tabRPGBrokeMaxIndex; i++)
            {
                if (i < globalRPGMaxIndex)
                {
                    int ii = i + 1;
                    placeList.Items.Add("[" + ii + "] " + asd.getItemNameList(globalRPGPlace[i]));
                }
            }
        }
Пример #11
0
        public Firework()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getFireworkTypeStrCount(); i++)
            {
                tabFireType.Items.Add(asd.getFireworkTypeStr(i));
            }
            clear();
            Config config = new Config();

            mcVersion = config.getSetting("[Personalize]", "MCVersion");
        }
        public Effect()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getEffectStrCount(); i++)
            {
                tabEffectSel.Items.Add(asd.getEffectStr(i));
            }
            clear();
            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(0.5);
            timer.Tick    += timer_Tick;
            timer.Start();
        }
Пример #13
0
        public Superflat()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            layerSel.Items.Add(SuperflatAir);
            for (int i = 1; i < asd.getItemNameListCount(); i++)
            {
                layerSel.Items.Add(asd.getItemNameList(i));
            }
            for (int i = 0; i < asd.getBiomeCount(); i++)
            {
                biomeSel.Items.Add(asd.getBiomeStr(i));
            }
            clear();
        }
Пример #14
0
        private void tabOther1TestforInvCreate_Click(object sender, RoutedEventArgs e)
        {
            AllSelData asd  = new AllSelData();
            string     temp = "/testfor @p {Inventory:[{Slot:" + tabOther1TestforInvSlot.Value + "b,id:\"" + asd.getItem(tabOther1TestforInvItem.SelectedIndex) + "\"";

            if (tabOther1TestforInvCount.Value > 1)
            {
                temp = temp + ",Count:" + tabOther1TestforInvCount.Value + "b";
            }
            if (tabOther1TestforInvMeta.Value > 0)
            {
                temp = temp + ",Damage:" + tabOther1TestforInvMeta.Value + "s";
            }
            if (globalNLString.Length > 0 || globalEnchString.Length > 0 || globalAttrString.Length > 0)
            {
                string tagTemp = "";
                if (globalNLString.Length > 0)
                {
                    tagTemp = tagTemp + globalNLString + ",";
                }
                if (globalEnchString.Length > 0)
                {
                    tagTemp = tagTemp + globalEnchString + ",";
                }
                if (globalAttrString.Length > 0)
                {
                    tagTemp = tagTemp + globalAttrString + ",";
                }
                if (globalHideflag != "")
                {
                    tagTemp += globalHideflag + ",";
                }
                if (tagTemp.Length >= 1)
                {
                    tagTemp = tagTemp.Remove(tagTemp.Length - 1, 1);
                }
                temp = temp + ",tag:{" + tagTemp + "}";
            }
            temp    += "}]}";
            finalStr = temp;
            Check checkbox = new Check();

            checkbox.showText(finalStr);
            checkbox.Show();
        }
        private void Init()
        {
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                ItemList1.Items.Add(asd.getItemNameList(i));
                ItemList2.Items.Add(asd.getItemNameList(i));
                ItemList3.Items.Add(asd.getItemNameList(i));
                ItemList4.Items.Add(asd.getItemNameList(i));
                ItemList5.Items.Add(asd.getItemNameList(i));
                ItemList6.Items.Add(asd.getItemNameList(i));
                ItemList7.Items.Add(asd.getItemNameList(i));
                ItemList8.Items.Add(asd.getItemNameList(i));
                ItemList9.Items.Add(asd.getItemNameList(i));
                ResultItem.Items.Add(asd.getItemNameList(i));
            }
        }
Пример #16
0
        private void tabOther1ClearCreate_Click(object sender, RoutedEventArgs e)
        {
            AllSelData asd  = new AllSelData();
            string     temp = "/clear @p " + asd.getItem(globalItemSel) + " " + globalItemMeta + " " + globalItemCount;

            if (tabOther1ClearHasName.IsChecked.Value || tabOther1ClearHasEnchant.IsChecked.Value || tabOther1ClearHasAttr.IsChecked.Value)
            {
                temp += " {";
            }
            if (tabOther1ClearHasName.IsChecked.Value)
            {
                temp += globalNLString + ",";
            }
            if (tabOther1ClearHasEnchant.IsChecked.Value)
            {
                temp += globalEnchString + ",";
            }
            if (tabOther1ClearHasAttr.IsChecked.Value)
            {
                temp += globalAttrString + ",";
            }
            if (globalHideflag != "")
            {
                temp += globalHideflag + ",";
            }
            if (tabOther1ClearHasName.IsChecked.Value || tabOther1ClearHasEnchant.IsChecked.Value || tabOther1ClearHasAttr.IsChecked.Value || globalHideflag != "")
            {
                if (temp.Length >= 1)
                {
                    temp = temp.Remove(temp.Length - 1, 1);
                }
                else
                {
                    //errorC = true;
                }
                temp += "}";
            }
            finalStr = temp;
            Check checkbox = new Check();

            checkbox.showText(finalStr);
            checkbox.Show();
        }
Пример #17
0
        public Banner()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getSignDirectionStrCount(); i++)
            {
                tabBannerFacing.Items.Add(asd.getSignDirectionStr(i));
            }
            for (int i = 0; i < asd.getBannerTypeCount(); i++)
            {
                tabBannerType.Items.Add(asd.getBannerTypeStr(i));
            }
            for (int i = 0; i < asd.getBannerColorCount(); i++)
            {
                tabBannerBaseColor.Items.Add(asd.getBannerColorStr(i));
                tabBannerColor.Items.Add(asd.getBannerColorStr(i));
            }
            clear();
        }
Пример #18
0
        public OtherMap()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                tabOther1HatSel.Items.Add(asd.getItemNameList(i));
                tabOther1ItemFlySel.Items.Add(asd.getItemNameList(i));
                tabOther1TestforInvItem.Items.Add(asd.getItemNameList(i));
            }
            tabOther1RideSel.Items.Add(OtherListNorth);
            tabOther1RideSel.Items.Add(OtherListSouth);
            tabOther1RideSel.Items.Add(OtherListWest);
            tabOther1RideSel.Items.Add(OtherListEast);
            tabOther1RideSel.SelectedIndex = 0;
            Config config = new Config();

            mcVersion = config.getSetting("[Personalize]", "MCVersion");
        }
Пример #19
0
        /// <summary>
        /// 为At窗口传值
        /// </summary>
        /// <returns>0:物品槽位,已转换成id\r\n1:物品英文id\r\n2:物品数量\r\n3:物品损害值\r\n4:物品的NBT数据,如无则空。</returns>
        public string[] returnStr()
        {
            AllSelData asd           = new AllSelData();
            int        itemslotindex = -1;

            if (tabRItemSlot.SelectedIndex < 7)
            {
                if (tabRItemSlot.SelectedIndex == 2)
                {
                    itemslotindex = -106;
                }
                if (tabRItemSlot.SelectedIndex == 3)
                {
                    itemslotindex = 100;
                }
                if (tabRItemSlot.SelectedIndex == 4)
                {
                    itemslotindex = 101;
                }
                if (tabRItemSlot.SelectedIndex == 5)
                {
                    itemslotindex = 102;
                }
                if (tabRItemSlot.SelectedIndex == 6)
                {
                    itemslotindex = 103;
                }
            }
            else if (tabRItemSlot.SelectedIndex < 43)
            {
                itemslotindex = tabRItemSlot.SelectedIndex - 7;
            }
            string nbtdata = string.Empty;

            if (finalStr.IndexOf('{') != -1)
            {
                nbtdata = finalStr.Substring(finalStr.IndexOf('{') + 1, finalStr.Length - finalStr.IndexOf('{') - 2);
            }
            return(new string[] { itemslotindex.ToString(), asd.getItem(tabRItemItem.SelectedIndex), tabRItemCount.Value.Value.ToString(), tabRItemMeta.Value.Value.ToString(), nbtdata });
        }
Пример #20
0
        public ReplaceItem()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getSlotStrCount(); i++)
            {
                tabRItemSlot.Items.Add(asd.getSlotStr(i));
            }
            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                tabRItemItem.Items.Add(asd.getItemNameList(i));
            }
            for (int i = 0; i < asd.getHideListCount(); i++)
            {
                tabRItemHide.Items.Add(asd.getHideList(i));
            }
            tabRItemBlock.IsChecked  = false;
            tabRItemEntity.IsChecked = true;
            clear();
        }
        private void checkBtn_Click(object sender, RoutedEventArgs e)
        {
            JObject allText = (JObject)JsonConvert.DeserializeObject(finalStr);

            if (!Directory.Exists(Directory.GetCurrentDirectory() + @"\data\"))
            {
                Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\data\");
            }
            AllSelData asd      = new AllSelData();
            string     filename = asd.getItem(ResultItem.SelectedIndex).Replace("minecraft:", "") + "_" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond + ".json";

            using (FileStream fs = new FileStream(Directory.GetCurrentDirectory() + @"\data\" + filename, FileMode.Create))
            {
                using (StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.UTF8))
                {
                    sw.Write(allText);
                }
            }
            Check cbox = new Check();

            cbox.showText(finalStr, LootTableSaveTitle + @"\data\" + filename);
            cbox.Show();
        }
Пример #22
0
        public At()
        {
            InitializeComponent();
            appLanguage();
            AllSelData asd = new AllSelData();

            for (int i = 0; i < asd.getAtListCount(); i++)
            {
                type.Items.Add(asd.getAtNameList(i));
            }
            for (int i = 0; i < asd.getItemNameListCount(); i++)
            {
                hand.Items.Add(asd.getItemNameList(i));
            }
            for (int i = 0; i < asd.getAtListCount(); i++)
            {
                rideEntity.Items.Add(asd.getAtNameList(i));
            }
            clear();
            Config config = new Config();

            mcVersion = config.getSetting("[Personalize]", "MCVersion");
        }
        private void tabEffectBitmapDraw()
        {
            AllSelData asd = new AllSelData();
            ImageFix   ifx = new ImageFix();

            if (tabEffectSel.SelectedIndex == 0 || tabEffectSel.SelectedIndex == 1)
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 0, 0, 0, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:saturation")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 35, 36, 248, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:wither")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 39, 42, 53, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:glowing")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 97, 160, 148, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:nausea")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 74, 29, 85, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:slowness")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 129, 108, 90, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:hunger")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 83, 118, 88, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:haste")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 67, 192, 217, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:fire_resistance")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 58, 154, 228, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:resistance")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 58, 69, 153, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:strength")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 35, 36, 147, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:unluck")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 77, 164, 192, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:levitation")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 255, 255, 206, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:absorption")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 58, 69, 153, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:regeneration")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 171, 92, 205, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:health_boost")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 35, 125, 248, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:blindness")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 35, 31, 31, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:water_breathing")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 153, 82, 46, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:instant_damage")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 9, 10, 67, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:instant_health")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 35, 36, 248, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:speed")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 198, 175, 124, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:jump_boost")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 151, 98, 120, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:mining_fatigue")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 23, 66, 74, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:luck")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 0, 153, 51, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:weakness")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 72, 77, 72, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:night_vision")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 161, 31, 31, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:invisibility")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 146, 131, 127, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
            else if (asd.getEffect(tabEffectSel.SelectedIndex, false) == "minecraft:poison")
            {
                BitmapSource tempBitmap = ifx.ChangeColor(tabEffectRandomBitmap(), new byte[] { 27, 27, 27, 255 }, new byte[] { 49, 147, 78, 255 });
                tempBitmap          = ifx.ChangeSize(tempBitmap, 8);
                tabEffectPic.Source = tempBitmap;
            }
        }
        private string backItemCom(ComboBox needChooseIndexComboBox, int whichIndex)
        {
            string whichItems       = "";
            string globalEnchString = "";
            string globalNLString   = "";
            string globalAttrString = "";
            string globalUnbreaking = "";
            string globalHideflag   = "";
            int    globalItemSel    = 0;
            int    globalItemCount  = 0;
            int    globalItemMeta   = 0;
            Item   itembox          = new Item();

            itembox.ShowDialog();
            string[] tempa = itembox.returnStr();
            int[]    tempb = itembox.returnStrAdver();
            if (tempa[0] != "ench:[]")
            {
                globalEnchString = tempa[0];
            }
            if (tempa[1] != "display:{}")
            {
                globalNLString = tempa[1];
            }
            if (tempa[2] != "AttributeModifiers:[]")
            {
                globalAttrString = tempa[2];
            }
            if (tempa[4] != "")
            {
                globalUnbreaking = tempa[4];
            }
            if (tempa[5] != "")
            {
                globalHideflag = tempa[5];
            }
            if (tempb[0] != 0)
            {
                globalItemSel = tempb[0];
            }
            globalItemCount = tempb[1];
            globalItemMeta  = tempb[2];
            //
            AllSelData asd = new AllSelData();

            needChooseIndexComboBox.SelectedIndex = globalItemSel;
            if (globalItemSel != 0)
            {
                int index = whichIndex - 1;
                whichItems = "" + index + ":{Slot:" + index + "b,id:\"" + asd.getItem(globalItemSel) + "\",Count:" + globalItemCount + "b,Damage:" + globalItemMeta + "s";
                if (globalEnchString != "" || globalNLString != "" || globalAttrString != "" || globalUnbreaking != "" || globalHideflag != "")
                {
                    whichItems += ",tag:{";
                    if (globalEnchString != "")
                    {
                        whichItems += globalEnchString + ",";
                    }
                    if (globalNLString != "")
                    {
                        whichItems += globalNLString + ",";
                    }
                    if (globalAttrString != "")
                    {
                        whichItems += globalAttrString + ",";
                    }
                    if (globalUnbreaking != "")
                    {
                        whichItems += globalUnbreaking + ",";
                    }
                    if (globalHideflag != "")
                    {
                        whichItems += globalHideflag + ",";
                    }
                    if (globalEnchString != "" || globalNLString != "" || globalAttrString != "" || globalUnbreaking != "" || globalHideflag != "")
                    {
                        whichItems = whichItems.Remove(whichItems.Count() - 1, 1);
                    }
                    whichItems += "}}";
                }
                else
                {
                    whichItems += "}";
                }
            }
            else
            {
                whichItems = "";
            }
            return(whichItems);
        }
        private void CustomNameColor_Copy_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            AllSelData asd = new AllSelData();

            CustomNameBox_Copy.SelectedText = asd.getUniColor(CustomNameColor_Copy.SelectedIndex);
        }
        private void createBtn_Click(object sender, RoutedEventArgs e)
        {
            AllSelData asd = new AllSelData();

            if (tabRPGOnlyBrokeSel.SelectedIndex < 0)
            {
                tabRPGOnlyBrokeSel.SelectedIndex = 0;
            }
            if (tabRPGOnlyPlaceSel.SelectedIndex < 0)
            {
                tabRPGOnlyPlaceSel.SelectedIndex = 0;
            }
            if (tabRPGBrokeMaxIndex >= globalRPGMaxIndex)
            {
                tabRPGBrokeMaxIndex = globalRPGMaxIndex - 1;
            }
            if (tabRPGPlaceMaxIndex >= globalRPGMaxIndex)
            {
                tabRPGPlaceMaxIndex = globalRPGMaxIndex - 1;
            }
            string giveDestroy = "";
            string givePlace   = "";

            if (tabRPGOnlyBroke.IsChecked.Value || tabRPGOnlyPlace.IsChecked.Value)
            {
                if (tabRPGOnlyBroke.IsChecked.Value)
                {
                    giveDestroy += "CanDestroy:[";
                    string give2 = "";
                    if (tabRPGBrokeCheckCanCreate == true)
                    {
                        for (int i = 0; i <= tabRPGBrokeMaxIndex; i++)
                        {
                            give2 = give2 + "\"" + asd.getItem(globalRPGBroke[i]) + "\",";
                        }
                        if (give2.Length >= 1)
                        {
                            give2 = give2.Remove(give2.Length - 1, 1);
                        }
                    }
                    else
                    {
                        this.ShowMessageAsync(FloatHelpTitle, AdvNeedNextBtn2Save, MessageDialogStyle.Affirmative, new MetroDialogSettings()
                        {
                            AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel
                        });
                    }
                    giveDestroy += give2 + "]";
                }
                if (tabRPGOnlyPlace.IsChecked.Value)
                {
                    givePlace += "CanPlaceOn:[";
                    string give2 = "";
                    if (tabRPGPlaceCheckCanCreate == true)
                    {
                        for (int i = 0; i <= tabRPGPlaceMaxIndex; i++)
                        {
                            give2 = give2 + "\"" + asd.getItem(globalRPGPlace[i]) + "\",";
                        }
                        if (give2.Length >= 1)
                        {
                            give2 = give2.Remove(give2.Length - 1, 1);
                        }
                    }
                    else
                    {
                        this.ShowMessageAsync(FloatHelpTitle, AdvNeedNextBtn2Save, MessageDialogStyle.Affirmative, new MetroDialogSettings()
                        {
                            AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel
                        });
                    }
                    givePlace += give2 + "]";
                }
                finalStrDestroy = giveDestroy;
                finalStrPlace   = givePlace;
            }
            else
            {
                finalStrDestroy = AdvNullSel;
                finalStrPlace   = AdvNullSel;
            }
        }
Пример #27
0
        private void createBtn_Click(object sender, RoutedEventArgs e)
        {
            if (atP.IsChecked.Value)
            {
                createText = "@p";
            }
            else if (atA.IsChecked.Value)
            {
                createText = "@a";
            }
            else if (atR.IsChecked.Value)
            {
                createText = "@r";
            }
            else if (atE.IsChecked.Value)
            {
                createText = "@e";
            }
            else if (atS.IsChecked.Value)
            {
                createText = "@s";
            }
            else
            {
                createText = "@p";
            }
            string extra = "";

            if (xyzCheck.IsChecked.Value)
            {
                extra += "x=" + x.Value.ToString() + ",y=" + y.Value.ToString() + ",z=" + z.Value.ToString() + ",";
            }
            if (dxCheck.IsChecked.Value)
            {
                extra += "dx=" + dx.Value.ToString() + ",";
                extra += "dy=" + dy.Value.ToString() + ",";
                extra += "dz=" + dz.Value.ToString() + ",";
            }
            if (rCheck.IsChecked.Value)
            {
                extra += "r=" + r.Value.ToString() + ",";
            }
            if (rmCheck.IsChecked.Value)
            {
                extra += "rm=" + rm.Value.ToString() + ",";
            }
            if (mCheck.IsChecked.Value)
            {
                if (mUN.IsChecked.Value)
                {
                    extra += "m=!" + m.Value.ToString() + ",";
                }
                else
                {
                    extra += "m=" + m.Value.ToString() + ",";
                }
            }
            if (rxCheck.IsChecked.Value)
            {
                extra += "rx=" + rx.Value.ToString() + ",";
            }
            if (rxmCheck.IsChecked.Value)
            {
                extra += "rxm=" + rxm.Value.ToString() + ",";
            }
            if (cCheck.IsChecked.Value)
            {
                extra += "c=" + c.Value.ToString() + ",";
            }
            if (ryCheck.IsChecked.Value)
            {
                extra += "ry=" + ry.Value.ToString() + ",";
            }
            if (rymCheck.IsChecked.Value)
            {
                extra += "rym=" + rym.Value.ToString() + ",";
            }
            if (lCheck.IsChecked.Value)
            {
                extra += "l=" + l.Value.ToString() + ",";
            }
            if (lmCheck.IsChecked.Value)
            {
                extra += "lm=" + lm.Value.ToString() + ",";
            }
            if (scoreCheck.IsChecked.Value)
            {
                extra += "score_" + scoreName.Text + "=" + score.Value.ToString() + ",";
            }
            if (scoreMinCheck.IsChecked.Value)
            {
                extra += "score_" + scoreMinName.Text + "_min=" + scoreMin.Value.ToString() + ",";
            }
            if (teamCheck.IsChecked.Value)
            {
                if (teamUN.IsChecked.Value)
                {
                    extra += "team=!" + team.Text + ",";
                }
                else
                {
                    extra += "team=" + team.Text + ",";
                }
            }
            if (nameCheck.IsChecked.Value)
            {
                if (nameUN.IsChecked.Value)
                {
                    extra += "name=!" + name.Text + ",";
                }
                else
                {
                    extra += "name=" + name.Text + ",";
                }
            }
            if (typeCheck.IsChecked.Value)
            {
                AllSelData asd = new AllSelData();
                if (typeUN.IsChecked.Value)
                {
                    extra += "type=!" + asd.getAt(type.SelectedIndex) + ",";
                }
                else
                {
                    extra += "type=" + asd.getAt(type.SelectedIndex) + ",";
                }
            }
            if (tagCheck.IsChecked.Value)
            {
                extra += "tag=" + tags.Text + ",";
            }
            if (NBTCheck.IsChecked.Value)
            {
                extra += "nbt=";
                if (NBTUN.IsChecked.Value)
                {
                    extra += "!";
                }
                extra += NBTTextbox.Text + ",";
            }
            if (extra.Length != 0)
            {
                extra       = extra.Remove(extra.Length - 1, 1);
                createText += "[" + extra + "]";
            }
            string nbt = "";

            if (flyCheck.IsChecked.Value)
            {
                nbt += "abilities:{flying:1b},";
            }
            if (handCheck.IsChecked.Value)
            {
                AllSelData asd   = new AllSelData();
                string     temp  = "";
                string     temp2 = "";
                if (handMeta.Value != -1)
                {
                    temp = ",Damage:" + handMeta.Value + "s";
                }
                if (getItemText.Text != "")
                {
                    temp2 = ",tag:{" + getItemText.Text + "}";
                }
                nbt += "SelectedItem:{id:\"" + asd.getItem(hand.SelectedIndex) + "\",Count:" + handCount.Value + "b" + temp + temp2 + "},";
            }
            if (itemCheck.IsChecked.Value && cmd != string.Empty)
            {
                nbt += cmd + ",";
            }
            if (InvCheck.IsChecked.Value && inv != string.Empty)
            {
                nbt += inv + ",";
            }
            if (rideCheck.IsChecked.Value)
            {
                AllSelData asd = new AllSelData();
                nbt += "RootVehicle:{Entity:{id:\"" + asd.getAt(rideEntity.SelectedIndex) + "\"}},";
            }
            if (nbt.Length != 0)
            {
                nbt         = nbt.Remove(nbt.Length - 1, 1);
                nbt         = "{" + nbt + "}";
                createText += " " + nbt;
            }
        }
Пример #28
0
        private void tabBannerPicCreater()
        {
            //show Bitmap
            ImageFix     ifix        = new ImageFix();
            AllSelData   asd         = new AllSelData();
            byte         r           = asd.getBannerColorArray(tabBannerBaseColor.SelectedIndex)[0];
            byte         g           = asd.getBannerColorArray(tabBannerBaseColor.SelectedIndex)[1];
            byte         b           = asd.getBannerColorArray(tabBannerBaseColor.SelectedIndex)[2];
            BitmapSource finalBitmap = ifix.ChangeColor(ifix.BitmapImage2BitmapSource(new BitmapImage(new Uri("pack://application:,,,/Images/Banner/background.png")), false), new byte[] { 255, 255, 255, 255 }, new byte[] { b, g, r, 255 });
            int          showIndex   = 0;

            if (tabBannerMaxIndex <= 0 && tabBannerEditIndex == 0)
            {
                showIndex = tabBannerMaxIndex;
            }
            else if (tabBannerMaxIndex >= 0 && tabBannerEditIndex != 0 && tabBannerMaxIndex < globalBannerMaxIndex - 2)
            {
                showIndex = tabBannerMaxIndex + 1;
            }
            else
            {
                showIndex = tabBannerMaxIndex;
            }
            for (int i = 0; i <= showIndex; i++)
            {
                byte r1 = asd.getBannerColorArray(globalBannerColor[i])[0];
                byte g1 = asd.getBannerColorArray(globalBannerColor[i])[1];
                byte b1 = asd.getBannerColorArray(globalBannerColor[i])[2];
                //BitmapSource K1Bitmap;
                //if (globalBannerType[i] == 3 || globalBannerType[i] == 4)
                //{
                //    //K1Bitmap = ifix.ChangeColor(tabBannerTypeSel(globalBannerType[i]), new byte[] { 0, 0, 0, 255 }, new byte[] { b1, g1, r1, 255 }, true);
                //    K1Bitmap =
                //    ifix.ChangeColor(
                //        ifix.ChangeColor(
                //            ifix.ChangeColor(tabBannerTypeSel(globalBannerType[i]), new byte[] { 0, 0, 0, 255 }, new byte[] { b1, g1, r1, 255 }, true)
                //        , new byte[] { 2, 3, 6, 255 }, new byte[] { (byte)(b1 + 2), (byte)(g1 + 3), (byte)(r1 + 6), 255 }, true)
                //    , new byte[] { 6, 5, 8, 255 }, new byte[] { (byte)(b1 + 6), (byte)(g1 + 5), (byte)(r1 + 8), 255 }, true);
                //}
                //else
                //{
                //    K1Bitmap = ifix.ChangeColor(tabBannerTypeSel(globalBannerType[i]), new byte[] { 0, 0, 0, 255 }, new byte[] { b1, g1, r1, 255 });
                //}
                BitmapSource K1Bitmap;
                if (globalBannerType[i] == 3)
                {
                    K1Bitmap = ifix.ChangeColor(tabBannerTypeSel(globalBannerType[i]), new byte[] { b1, g1, r1, 255 }, true);
                }
                else if (globalBannerType[i] == 4)
                {
                    K1Bitmap = ifix.ChangeColor(tabBannerTypeSel(globalBannerType[i]), new byte[] { b1, g1, r1, 255 }, false);
                }
                else
                {
                    K1Bitmap = ifix.ChangeColor(tabBannerTypeSel(globalBannerType[i]), new byte[] { 0, 0, 0, 255 }, new byte[] { b1, g1, r1, 255 });
                }
                finalBitmap = ifix.Merger(finalBitmap, K1Bitmap);
            }
            finalBitmap         = ifix.ChangeSize(finalBitmap, 13);
            tabBannerPic.Source = finalBitmap;
        }
Пример #29
0
        private void createBtn_Click(object sender, RoutedEventArgs e)
        {
            if (tabBannerFacing.SelectedIndex < 0)
            {
                tabBannerFacing.SelectedIndex = 0;
            }
            if (tabBannerBaseColor.SelectedIndex < 0)
            {
                tabBannerBaseColor.SelectedIndex = 0;
            }
            for (int i = 0; i < globalBannerMaxIndex; i++)
            {
                if (globalBannerType[i] < 0)
                {
                    globalBannerType[i] = 0;
                }
                if (globalBannerColor[i] < 0)
                {
                    globalBannerColor[i] = 0;
                }
            }
            if (tabBannerMaxIndex >= globalBannerMaxIndex)
            {
                tabBannerMaxIndex = globalBannerMaxIndex - 1;
            }
            string first  = "";
            string second = "";

            if (tabBannerGive.IsChecked.Value)
            {
                if (ShieldCheck.IsChecked.Value)
                {
                    first = "/give @p minecraft:shield 1 0";
                }
                else
                {
                    first = "/give @p minecraft:banner 1 " + tabBannerBaseColor.SelectedIndex;
                }
                if (tabBannerHasMoreAttr.IsChecked.Value)
                {
                    second = "{";
                    if (globalEnchString.Length != 0)
                    {
                        second += globalEnchString + ",";
                    }
                    if (globalNLString.Length != 0)
                    {
                        second += globalNLString + ",";
                    }
                    if (globalAttrString.Length != 0)
                    {
                        second += globalAttrString + ",";
                    }
                    if (globalHideflag.Length != 0)
                    {
                        second += globalHideflag + ",";
                    }
                    second += "BlockEntityTag:{Base:" + tabBannerBaseColor.SelectedIndex + ",Patterns:[";
                }
                else
                {
                    second = "{BlockEntityTag:{Base:" + tabBannerBaseColor.SelectedIndex + ",Patterns:[";
                }
            }
            else
            {
                first   = "/setblock ~ ~1 ~ minecraft:standing_banner " + tabBannerFacing.SelectedIndex + " replace";
                second += "{Base:" + tabBannerBaseColor.SelectedIndex + ",Patterns:[";
            }
            string third = "";

            if (tabBannerCheckCanCreate == true)
            {
                for (int i = 0; i <= tabBannerMaxIndex; i++)
                {
                    AllSelData asd = new AllSelData();
                    third = third + "{Pattern:\"" + asd.getBannerType(globalBannerType[i]) + "\",Color:" + globalBannerColor[i] + "},";
                }
                if (third.Length >= 1)
                {
                    third = third.Remove(third.Length - 1, 1);
                }
            }
            else
            {
                string temp = BannerAtLeastClickOnce;
                this.ShowMessageAsync("", temp, MessageDialogStyle.Affirmative, new MetroDialogSettings()
                {
                    AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel, AnimateShow = true
                });
            }
            string end = first + " " + second + third + "]}";

            if (tabBannerGive.IsChecked.Value)
            {
                end += "}";
            }
            finalStr = end;
            if (tabBannerShow.IsChecked.Value)
            {
                tabBannerPicCreater();
            }
        }
Пример #30
0
        private void createBtn_Click(object sender, RoutedEventArgs e)
        {
            //errorC = false;
            if (tabRItemSlot.SelectedIndex < 0)
            {
                tabRItemSlot.SelectedIndex = 0;
            }
            if (tabRItemItem.SelectedIndex < 0)
            {
                tabRItemItem.SelectedIndex = 0;
            }
            if (tabRItemHide.SelectedIndex < 0)
            {
                tabRItemHide.SelectedIndex = 0;
            }
            string replaceItemStr = "";

            if (tabRItemEntity.IsChecked == true)
            {
                replaceItemStr += "/replaceitem entity " + atStr + " ";
                //if (tabRItemSlot.SelectedIndex == 0) errorC = true;
                //if (tabRItemItem.SelectedIndex == 0) errorC = true;
                AllSelData asd = new AllSelData();
                replaceItemStr = replaceItemStr + asd.getSlot(tabRItemSlot.SelectedIndex) + " " + asd.getItem(tabRItemItem.SelectedIndex) + " " + tabRItemCount.Value.Value + " " + tabRItemMeta.Value.Value;
                string meta = tabRItemGetBackMeta();
                if (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true)
                {
                    replaceItemStr += " {" + meta;
                }
                if (tabRItemUnbreaking.IsChecked == true && (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true))
                {
                    replaceItemStr += ",Unbreakable:1}";
                }
                else if (tabRItemUnbreaking.IsChecked == true && tabRItemHasEnchant.IsChecked == false && tabRItemHasNL.IsChecked == false && tabRItemHasAttr.IsChecked == false)
                {
                    replaceItemStr += " {Unbreakable:1}";
                }
                else if (tabRItemUnbreaking.IsChecked == false && (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true))
                {
                    replaceItemStr += "}";
                }
                finalStr = replaceItemStr;
            }
            else if (tabRItemBlock.IsChecked == true)
            {
                //if (tabRItemSlot.SelectedIndex == 0) errorC = true;
                //if (tabRItemItem.SelectedIndex == 0) errorC = true;
                replaceItemStr = replaceItemStr + "/replaceitem block ";
                if (tabRItemXNum.IsChecked == true)
                {
                    replaceItemStr = replaceItemStr + "~ ~ ~ ";
                }
                else
                {
                    replaceItemStr = replaceItemStr + tabRItemX.Value + " " + tabRItemY.Value + " " + tabRItemZ.Value + " ";
                }
                AllSelData asd = new AllSelData();
                replaceItemStr = replaceItemStr + asd.getSlot(tabRItemSlot.SelectedIndex) + " " + asd.getItem(tabRItemItem.SelectedIndex) + " " + tabRItemCount.Value.Value + " " + tabRItemMeta.Value.Value;
                string meta = tabRItemGetBackMeta();
                if (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true)
                {
                    replaceItemStr += " {" + meta;
                }
                if (tabRItemUnbreaking.IsChecked == true && (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true))
                {
                    replaceItemStr += ",Unbreakable:1}";
                }
                else if (tabRItemUnbreaking.IsChecked == true && tabRItemHasEnchant.IsChecked == false && tabRItemHasNL.IsChecked == false && tabRItemHasAttr.IsChecked == false)
                {
                    replaceItemStr += " {Unbreakable:1}";
                }
                else if (tabRItemUnbreaking.IsChecked == false && (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true))
                {
                    replaceItemStr += "}";
                }
                finalStr = replaceItemStr;
            }
            else
            {
                //errorC = true;
                //finalStr = "初始选择错误,请检查!";
            }
        }