Exemple #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (sender == clear)
     {
         CmdGenWindow.AddCommand("/title " + ES.GetEntity() + " clear");
     }
     else
     {
         CmdGenWindow.AddCommand("/title " + ES.GetEntity() + " reset");
     }
 }
 public string GenerateCommand()
 {
     if (c1.IsChecked == true)
     {
         return("/testfor " + ES.GetEntity() + (enbt.Text == "" ? "" : " " + enbt.Text));
     }
     else if (c2.IsChecked == true)
     {
         return("等待更新");
         //return "/testforblock "+loc.GetLocation()+"";
     }
     else if (c3.IsChecked == true)
     {
         return("等待更新");
     }
     else
     {
         return("/execute " + ES.GetEntity() + " " + exeloc.GetLocation() + (detect.IsChecked == true ? " detect " + detectloc.GetLocation() + " " + detectblockinfo.Text : " ") + cmd.Text);
     }
 }
Exemple #3
0
 public string GenerateCommand()
 {
     if (setTime.IsChecked == true)
     {
         return("/title " + ES.GetEntity() + " times " + fadeIn.Value + " " + stay.Value + " " + fadeOut.Value);
     }
     else
     {
         string cmd = "";
         if (T.IsChecked == true)
         {
             cmd = "/title " + ES.GetEntity() + " title ";
         }
         else if (subT.IsChecked == true)
         {
             cmd = "/title " + ES.GetEntity() + " subtitle ";
         }
         else
         {
             cmd = "/title " + ES.GetEntity() + " actionbar ";
         }
         return(cmd + doc.GetJsonText());
     }
 }
Exemple #4
0
        public string GenerateCommand()
        {
            if (Give.IsChecked == true)
            {
                string NBT = give_NBT.Text;
                if (NBT == "")
                {
                    return("请填写NBT数据!");
                }
                string[] s = { "tag:" };
                s = NBT.Split(s, StringSplitOptions.None);
                string[] info = s[0].Substring(1, s[0].Length - 1).Split(',');
                if (info.Length <= 3)
                {
                    return("物品NBT标签错误");
                }
                string result = "/give " + ES.GetEntity() + " minecraft:" + info[0].Replace("id:", "").Replace("\"", "") + " " + info[1].Replace("Count:", "") + " " + info[2].Replace("Damage:", "");
                int    i      = info[0].Length + info[1].Length + info[2].Length + 8;
                string tag    = NBT.Substring(i, NBT.Length - i - 1);
                if (tag != "{}")
                {
                    result += " " + tag;
                }
                return(result);
            }
            else if (Summon.IsChecked == true)
            {
                string NBT = summon_NBT.Text;
                if (NBT == "")
                {
                    return("请填写NBT数据!");
                }
                string id = NBT.Split(',')[0];
                if (!id.Contains("id:"))
                {
                    return("错误的实体ID!");
                }
                id = id.Replace("{", "").Replace("id:", "").Replace("}", "");
                if (id.Length == 0)
                {
                    return("错误的实体ID!");
                }
                if (loc.GetLocation() == "")
                {
                    return("/summon " + id);
                }
                NBT = " {" + NBT.Substring(id.Length + 5, NBT.Length - id.Length - 5);
                return("/summon " + id + " " + loc.GetLocation() + NBT);
            }
            else
            {
                string NBT = replace_NBT.Text;
                if (NBT == "")
                {
                    return("请填写NBT数据!");
                }
                string[] s = { "tag:" };
                s = NBT.Split(s, StringSplitOptions.None);
                string[] info = s[0].Substring(1, s[0].Length - 1).Split(',');
                if (info.Length <= 3)
                {
                    return("物品NBT标签错误");
                }
                string result = "minecraft:" + info[0].Replace("id:", "").Replace("\"", "") + " " + info[1].Replace("Count:", "") + " " + info[2].Replace("Damage:", "");
                int    i      = info[0].Length + info[1].Length + info[2].Length + 8;
                string tag    = NBT.Substring(i, NBT.Length - i - 1);
                if (tag != "{}")
                {
                    result += " " + tag;
                }

                string slot = "", target = "";
                switch (replaceMode.SelectedIndex)
                {
                case 0: slot = "slot.horse.saddle"; break;

                case 1: slot = "slot.horse.armor"; break;

                case 2: switch (menu.SelectedIndex)
                    {
                    case 0: slot = (string)B1.ToolTip; break;

                    case 1: slot = (string)B2.ToolTip; break;

                    case 2: slot = (string)B3.ToolTip; break;
                    }
                    break;
                }
                switch (menu.SelectedIndex)
                {
                case 0: target = "entity " + ES.GetEntity(); break;

                case 1: target = "block " + block_loc.GetLocation(); break;

                case 2: if (chest.IsChecked == true)
                    {
                        target = "block " + block_loc.GetLocation();
                    }
                    else
                    {
                        target = "entity " + ES.GetEntity();
                    } break;
                }

                return("/replaceitem " + target + " " + slot + " " + result);
            }
        }
 public string GenerateCommand()
 {
     return("/tellraw " + ES.GetEntity() + " " + doc.GetJsonText());
 }
Exemple #6
0
 private void AddSelector_Click(object sender, RoutedEventArgs e)
 {
     JsonEditor.AddSelectorTextUI.Selector.Text = ES.GetEntity();
     JsonEditor.AddSelectorTextUI.Editor        = editing;
     editing.Window.ShowDialog(JsonEditor.AddSelectorTextUI, JsonEditor.AddSelectorTextUI.Apply, JsonEditor.AddSelectorTextUI.Cancel);
 }
Exemple #7
0
        public string GenerateCommand()
        {
            string info = "";

            if (give.IsChecked == true)
            {
                info = "/give " + ES.GetEntity() + " minecraft:sign " + amount.Value + " 0 ";
            }
            if (block.IsChecked == true)
            {
                if (isData.IsChecked == true)
                {
                    info = "/blockdata ";
                }
                else
                {
                    info = "/setblock ";
                }
                if (tilde.IsChecked == true)
                {
                    info += "~" + LocX.Text + " ~" + LocY.Text + " ~" + LocZ.Text;
                }
                else
                {
                    if (LocX.Text == "" || LocY.Text == "" || LocZ.Text == "")
                    {
                        return("请填写坐标");
                    }
                    else
                    {
                        info += LocX.Text + " " + LocY.Text + " " + LocZ.Text;
                    }
                }
                if (isData.IsChecked == false)
                {
                    int face = 5;
                    if (state == "standing_sign")
                    {
                        if (S.IsChecked == true)
                        {
                            face = 0;
                        }
                        if (SWS.IsChecked == true)
                        {
                            face = 1;
                        }
                        if (SW.IsChecked == true)
                        {
                            face = 2;
                        }
                        if (SWW.IsChecked == true)
                        {
                            face = 3;
                        }
                        if (W.IsChecked == true)
                        {
                            face = 4;
                        }
                        if (NWW.IsChecked == true)
                        {
                            face = 5;
                        }
                        if (NW.IsChecked == true)
                        {
                            face = 6;
                        }
                        if (NWN.IsChecked == true)
                        {
                            face = 7;
                        }
                        if (N.IsChecked == true)
                        {
                            face = 8;
                        }
                        if (NEN.IsChecked == true)
                        {
                            face = 9;
                        }
                        if (NE.IsChecked == true)
                        {
                            face = 10;
                        }
                        if (NEE.IsChecked == true)
                        {
                            face = 11;
                        }
                        if (E.IsChecked == true)
                        {
                            face = 12;
                        }
                        if (NEE.IsChecked == true)
                        {
                            face = 13;
                        }
                        if (NE.IsChecked == true)
                        {
                            face = 14;
                        }
                        if (NEN.IsChecked == true)
                        {
                            face = 15;
                        }
                    }
                    else
                    {
                        if (E.IsChecked == true)
                        {
                            face = 5;
                        }
                        if (S.IsChecked == true)
                        {
                            face = 3;
                        }
                        if (W.IsChecked == true)
                        {
                            face = 4;
                        }
                        if (N.IsChecked == true)
                        {
                            face = 2;
                        }
                    }
                    info += " minecraft:" + state + " " + face + " ";
                    if (isData.IsChecked != true)
                    {
                        info += "replace ";
                    }
                }
                else
                {
                    info += " ";
                }
            }
            if (item.IsChecked == true)
            {
                info = "/replaceitem entity " + ES.GetEntity() + " " + " slot.inventory." + ivt.Text + " minecraft:sign 1 0 ";
            }
            return(info + GetTag());
        }
 public string GenerateCommand()
 {
     return("/give " + ES.GetEntity() + " minecraft:written_book " + count.Value + " 0 " + GetTag());
 }