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 tabSumosHasHeadID_Click(object sender, RoutedEventArgs e) { if (tabSumosHasHeadID.IsChecked.Value) { tabSumosHeadID.IsEnabled = true; tabSumosHead.IsEnabled = false; globalSumosTempSel = tabSumosHead.SelectedIndex; AllSelData asd = new AllSelData(); int tempIndex = 0; for (int i = 0; i < asd.getItemNameListCount(); i++) { if (asd.getItem(i) == "minecraft:skull") { tempIndex = i; continue; } } tabSumosHead.SelectedIndex = tempIndex; } else { tabSumosHeadID.IsEnabled = false; tabSumosHead.SelectedIndex = globalSumosTempSel; tabSumosHead.IsEnabled = true; } }
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) { if (rbTestfor.IsChecked.Value) { finalStr = "/testfor " + at; } else { finalStr = "/execute " + at + " ~" + x.Value.Value + " ~" + y.Value.Value + " ~" + z.Value.Value + " "; 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", "~"); } }
private void clear() { for (int i = 0; i < 4; i++) { clear(i); } AllSelData asd = new AllSelData(); for (int i = 0; i < asd.getItemNameListCount(); i++) { if (asd.getItem(i) == "minecraft:sand") { FallingSandItemSel.SelectedIndex = i; continue; } } }
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 tabOther1LockCreate_Click(object sender, RoutedEventArgs e) { AllSelData asd = new AllSelData(); string temp = "/setblock ~ ~1 ~ " + asd.getItem(tabOther1LockItem.SelectedIndex) + " 0 replace {Lock:\"" + tabOther1LockPassword.Text + "\"}"; finalStr = temp; Check checkbox = new Check(); checkbox.showText(finalStr); checkbox.Show(); }
private void createBtn_Click(object sender, RoutedEventArgs e) { if (SFCheckCanCreate) { AllSelData asd = new AllSelData(); string version = "3"; string blockStack = ""; string biome = ""; string other = ""; //blockStack for (int i = 0; i < SFMaxIndex; i++) { if (globalSFBlockCount[i] != 1) { blockStack += globalSFBlockCount[i].ToString() + "*"; } if (globalSFBlockID[i] != 0) { blockStack += asd.getItem(globalSFBlockID[i]); } else { blockStack += "minecraft:air"; } if (globalSFBlockDamage[i] != 0) { blockStack += ":" + globalSFBlockDamage[i]; } blockStack += ","; } if (SFMaxIndex > 1) { blockStack = blockStack.Remove(blockStack.Count() - 1, 1); } //biome biome = asd.getBiomeID(biomeSel.SelectedIndex).ToString(); //other if (CheckVillage.IsChecked.Value) { other += "village"; if (CheckVillageSize.IsChecked.Value || CheckVillageDistance.IsChecked.Value) { string add = "("; if (CheckVillageSize.IsChecked.Value) { add += "size=" + VillageSize.Value.ToString() + " "; } if (CheckVillageDistance.IsChecked.Value) { add += "distance=" + VillageDistance.Value.ToString() + " "; } add = add.Remove(add.Count() - 1, 1); add += ")"; other += add; } other += ","; } if (CheckMineshaft.IsChecked.Value) { other += "mineshaft"; if (CheckMineshaftChance.IsChecked.Value) { string add = "("; add += "chance=" + MineshaftChance.Value.ToString(); add += ")"; other += add; } other += ","; } if (CheckStronghold.IsChecked.Value) { other += "stronghold"; if (CheckStrongholdCount.IsChecked.Value || CheckStrongholdDistance.IsChecked.Value || CheckStrongholdSpread.IsChecked.Value) { string add = "("; if (CheckStrongholdCount.IsChecked.Value) { add += "count=" + StrongholdCount.Value.ToString() + " "; } if (CheckStrongholdDistance.IsChecked.Value) { add += "distance=" + StrongholdDistance.Value.ToString() + " "; } if (CheckStrongholdSpread.IsChecked.Value) { add += "spread=" + StrongholdSpread.Value.ToString() + " "; } add = add.Remove(add.Count() - 1, 1); add += ")"; other += add; } other += ","; } if (CheckBiome.IsChecked.Value) { other += "biome_1"; if (CheckBiomeChance.IsChecked.Value) { string add = "("; add += "distance=" + BiomeChance.Value.ToString(); add += ")"; other += add; } other += ","; } if (CheckDungeon.IsChecked.Value) { other += "dungeon,"; } if (CheckDecoration.IsChecked.Value) { other += "decoration,"; } if (CheckLake.IsChecked.Value) { other += "lake,"; } if (CheckLavaLake.IsChecked.Value) { other += "lava_lake,"; } if (CheckOceanmonument.IsChecked.Value) { other += "oceanmonument,"; } if (other.Count() > 0) { other = other.Remove(other.Count() - 1, 1); } //create finalStr = version + ";" + blockStack + ";" + biome + ";" + other; } else { this.ShowMessageAsync("", SuperflatAtLeastClickOnce, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel, AnimateShow = true }); } }
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; } }
private string[] getItem() { Item itembox = new Item(); itembox.ShowDialog(); string nbt = itembox.returnStr()[10]; int[] temp = itembox.returnStrAdver(); AllSelData asd = new AllSelData(); return new string[] { nbt, asd.getItemNameList(temp[0]), temp[1].ToString(), temp[2].ToString(), asd.getItem(temp[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 + " " + tabRItemMeta.Value; string meta = tabRItemGetBackMeta(); if (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true) { replaceItemStr = replaceItemStr + " {" + meta + "}"; } 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 + " " + tabRItemMeta.Value; string meta = tabRItemGetBackMeta(); if (tabRItemHasEnchant.IsChecked == true || tabRItemHasNL.IsChecked == true || tabRItemHasAttr.IsChecked == true) { replaceItemStr = 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 = "初始选择错误,请检查!"; } }
private void bHEShowItem_Click(object sender, RoutedEventArgs e) { AllSelData asd = new AllSelData(); Item itembox = new Item(); itembox.ShowDialog(); int[] temp1 = itembox.returnStrAdver(); string[] temp2 = itembox.returnStr(); string strHead = ""; string str = "tag:{" + temp2[0] + "," + temp2[1] + "," + temp2[2] + "," + temp2[4] + "," + temp2[5] + "," + temp2[8] + "," + temp2[9] + "}}"; for (int i = 0; i < 3; i++) { str = str.Replace(",,", ","); } if (rbBook.IsChecked.Value) { str = str.Replace("\"", "\\\\\\\""); strHead = "{id:\\\\\\\"" + asd.getItem(temp1[0]) + "\\\\\\\",Count:" + temp1[1] + "b,Damage:" + temp1[2] + "s,"; } else { str = str.Replace("\"", "\\\""); strHead = "{id:\\\"" + asd.getItem(temp1[0]) + "\\\",Count:" + temp1[1] + "b,Damage:" + temp1[2] + "s,"; } tHEShowItem.Text = strHead + str; }
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 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 { 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 (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 != "") { nbt += cmd + ","; } 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; } }
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(); finalStr = "/summon ArmorStand ~ ~1 ~ {Tags:[\"HoloItems\"],PersistenceRequired:1b,DisabledSlots:2039583,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Passengers:[0:{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(); }
private void tabVillagerCGet_Click(object sender, RoutedEventArgs e) { AllSelData asd = new AllSelData(); if (asd.getItem(tabVillagerC.SelectedIndex) == "minecraft:splash_potion" || asd.getItem(tabVillagerC.SelectedIndex) == "minecraft:lingering_potion" || asd.getItem(tabVillagerC.SelectedIndex) == "minecraft:potion") { string[] receive = tabVillagerGetPotion(); globalVillagerCStr[tabVillagerEditIndex] = "CustomPotionEffects:[" + globalPotionString + "]" + globalPotionNBT; tabVillagerCCount.Value = int.Parse(receive[1]); tabVillagerCMeta.Value = int.Parse(receive[2]); tabVillagerCMetaCheck.IsChecked = true; tabVillagerCMeta.IsEnabled = true; } else { string[] receive = tabVillagerGetBackMeta("Item"); tabVillagerC.SelectedIndex = int.Parse(receive[0]); tabVillagerCCount.Value = int.Parse(receive[1]); tabVillagerCMeta.Value = int.Parse(receive[2]); globalVillagerCStr[tabVillagerEditIndex] = receive[3]; } }
private void tabOther1JukeboxCreate_Click(object sender, RoutedEventArgs e) { if (tabOther1JukeboxItemSel.SelectedIndex < 0) { tabOther1JukeboxItemSel.SelectedIndex = 0; } AllSelData asd = new AllSelData(); string temp = "/setblock ~ ~1 ~ minecraft:jukebox 1 replace {RecordItem:{id:\"" + asd.getItem(tabOther1JukeboxItemSel.SelectedIndex) + "\",Count:" + tabOther1JukeboxCount.Value + "b,Damage:" + tabOther1JukeboxMeta.Value + "s"; string nbt = ""; if (tabOther1JukeboxHasNBT.IsChecked.Value) { 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; } } if (nbt != "") nbt += ","; temp = temp + ",tag:{" + nbt + "HideFlags:" + globalHideSelIndex + "}"; } temp += "}}"; finalStr = temp; Check checkbox = new Check(); checkbox.showText(finalStr); checkbox.Show(); }
private string[] HorseItemGet() { Item itembox = new Item(); itembox.ShowDialog(); string[] temp = itembox.returnStr(); int[] temp0 = itembox.returnStrAdver(); AllSelData asd = new AllSelData(); if (temp[10] == string.Empty) { return new string[] { asd.getItem(temp0[0]), temp0[1].ToString(), temp0[2].ToString(), string.Empty }; } else { return new string[] { asd.getItem(temp0[0]), temp0[1].ToString(), temp0[2].ToString(), ",tag:{" + temp[10] + "}" }; } }
private void tabOther1LockUnlock_Click(object sender, RoutedEventArgs e) { AllSelData asd = new AllSelData(); string temp = "/give @p " + asd.getItem(tabOther1LockItem.SelectedIndex) + " 1 0 {display:{Name:\"" + tabOther1LockPassword.Text + "\",Lore:[\"" + OtherHelpUnlockKeyLore + "\"]}}"; finalStr = temp; Clipboard.SetData(DataFormats.UnicodeText, temp); string temp2 = OtherHelpUnlock + temp; this.ShowMessageAsync(FloatHelpTitle, temp2, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); }
private void FrameGetItemBtn_Click(object sender, RoutedEventArgs e) { AllSelData asd = new AllSelData(); Item itembox = new Item(); itembox.ShowDialog(); string[] temp = itembox.returnStr(); int[] temp2 = itembox.returnStrAdver(); globalFrameItem[0] = temp2[1].ToString();//count globalFrameItem[1] = temp2[2].ToString();//damage globalFrameItem[2] = asd.getItem(temp2[0]);//id globalFrameItem[3] = temp[10];//tag }
private void tabOther1ClearCreate_Click(object sender, RoutedEventArgs e) { AllSelData asd = new AllSelData(); string temp = "/clear @p " + asd.getItem(globalItemSel) + " " + globalItemCount + " " + globalItemMeta; 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(); }
private void EntryCreateBtn_Click(object sender, RoutedEventArgs e) { string tempEntry = "{"; if (EntryGetConditionBtn.IsChecked.Value) { if (globalCondition != "") { tempEntry += globalCondition + ","; } } if (EntryItem.IsChecked.Value) { AllSelData asd = new AllSelData(); tempEntry += "\"type\":\"item\",\"name\":\"" + asd.getItem(EntryItemSel.SelectedIndex) + "\","; } else if(EntryLoottable.IsChecked.Value) { tempEntry += "\"type\":\"loot_table\",\"name\":\"" + EntryLoottableSel.Text + "\","; } else { tempEntry += "\"type\":\"empty\","; } if (EntryGetFunctionBtn.IsChecked.Value) { if (globalFunction != "") { tempEntry += globalFunction + ","; } } tempEntry += "\"weight\":" + EntryWeight.Value.Value + ",\"quality\":" + EntryQuality.Value.Value + "},"; globalEntry += tempEntry; globalIndexEntry++; EntryParaNum.Content = "- " + globalIndexEntry + " -"; }