From fd95baf5f71879c12869c50fdfcf489b4e43bf98 Mon Sep 17 00:00:00 2001 From: Marcel Konrad Date: Fri, 6 Nov 2020 20:08:10 +0100 Subject: [PATCH] Replace passenger with custom nbt field, Add submenu for custom name formatting --- .../builder/component/impl/EntityNBT.java | 33 +- .../builder/impl/BuilderEntity.java | 509 ++++++++++++++++++ .../builder/impl/BuilderSummon.java | 482 +---------------- .../gui/content/impl/ContentSignEditor.java | 2 +- .../gui/content/impl/ContentSummon.java | 144 ++--- .../gui/menu/impl/ILogicColorMenu.java | 5 + .../gui/menu/impl/MenuColorField.java | 15 +- .../assets/worldhandler/lang/de_de.json | 9 +- .../assets/worldhandler/lang/en_us.json | 7 +- .../assets/worldhandler/lang/fr_fr.json | 5 +- .../assets/worldhandler/lang/ru_ru.json | 5 +- .../assets/worldhandler/lang/zh_cn.json | 5 +- 12 files changed, 656 insertions(+), 565 deletions(-) create mode 100644 src/main/java/exopandora/worldhandler/builder/impl/BuilderEntity.java diff --git a/src/main/java/exopandora/worldhandler/builder/component/impl/EntityNBT.java b/src/main/java/exopandora/worldhandler/builder/component/impl/EntityNBT.java index 08362b2..ea42a96 100644 --- a/src/main/java/exopandora/worldhandler/builder/component/impl/EntityNBT.java +++ b/src/main/java/exopandora/worldhandler/builder/component/impl/EntityNBT.java @@ -8,6 +8,8 @@ import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import com.mojang.brigadier.exceptions.CommandSyntaxException; + import exopandora.worldhandler.builder.component.IBuilderComponent; import exopandora.worldhandler.util.MutableStringTextComponent; import exopandora.worldhandler.util.NBTHelper; @@ -21,6 +23,7 @@ import net.minecraft.nbt.ByteNBT; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.INBT; import net.minecraft.nbt.IntNBT; +import net.minecraft.nbt.JsonToNBT; import net.minecraft.nbt.StringNBT; import net.minecraft.potion.Effect; import net.minecraft.util.ResourceLocation; @@ -43,6 +46,7 @@ public class EntityNBT implements IBuilderComponent private ResourceLocation[] armorItems = {Items.AIR.getRegistryName(), Items.AIR.getRegistryName(), Items.AIR.getRegistryName(), Items.AIR.getRegistryName()}; private ResourceLocation[] handItems = {Items.AIR.getRegistryName(), Items.AIR.getRegistryName()}; private ComponentPotionMob potion = new ComponentPotionMob(); + private CompoundNBT nbt; public EntityNBT() { @@ -300,7 +304,7 @@ public class EntityNBT implements IBuilderComponent { return this.potion.getAmplifier(potion); } - + public int getSeconds(Effect potion) { return this.potion.getSeconds(potion); @@ -381,6 +385,28 @@ public class EntityNBT implements IBuilderComponent return this.command; } + public void setNBT(CompoundNBT nbt) + { + this.nbt = nbt; + } + + public CompoundNBT getNBT() + { + return this.nbt; + } + + public void setNBT(String nbt) + { + try + { + this.nbt = JsonToNBT.getTagFromJson("{" + nbt + "}"); + } + catch(CommandSyntaxException e) + { + this.nbt = null; + } + } + @Override public CompoundNBT serialize() { @@ -414,6 +440,11 @@ public class EntityNBT implements IBuilderComponent NBTHelper.append(nbt, this.potion); NBTHelper.append(nbt, this.attribute); + if(this.nbt != null) + { + nbt.merge(this.nbt); + } + if(nbt.isEmpty()) { return null; diff --git a/src/main/java/exopandora/worldhandler/builder/impl/BuilderEntity.java b/src/main/java/exopandora/worldhandler/builder/impl/BuilderEntity.java new file mode 100644 index 0000000..7940427 --- /dev/null +++ b/src/main/java/exopandora/worldhandler/builder/impl/BuilderEntity.java @@ -0,0 +1,509 @@ +package exopandora.worldhandler.builder.impl; + +import java.util.List; +import java.util.Random; +import java.util.Set; + +import javax.annotation.Nullable; + +import org.apache.commons.lang3.StringUtils; + +import exopandora.worldhandler.builder.CommandBuilderNBT; +import exopandora.worldhandler.builder.component.impl.EntityNBT; +import exopandora.worldhandler.util.MutableStringTextComponent; +import exopandora.worldhandler.util.ResourceHelper; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.ai.attributes.Attribute; +import net.minecraft.entity.merchant.villager.VillagerProfession; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.nbt.ByteNBT; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.IntNBT; +import net.minecraft.nbt.ListNBT; +import net.minecraft.potion.Effect; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.registries.ForgeRegistries; + +@OnlyIn(Dist.CLIENT) +public abstract class BuilderEntity extends CommandBuilderNBT +{ + private final EntityNBT nbt = new EntityNBT(); + + public abstract void setEntity(ResourceLocation entity); + + public abstract ResourceLocation getEntity(); + + public void setName(String name) + { + this.setEntity(BuilderEntity.parseEntityName(name)); + this.updateCustomComponent(name); + } + + public void setNameAndId(String name) + { + this.setName(name); + this.nbt.setId(this.getEntity()); + } + + public void setId(ResourceLocation resource) + { + this.nbt.setId(resource); + } + + public ResourceLocation getId() + { + return this.nbt.getId(); + } + + public void setAttribute(Attribute attribute, double ammount) + { + this.nbt.setAttribute(attribute, ammount); + } + + public void removeAttribute(Attribute attribute) + { + this.nbt.removeAttribute(attribute); + } + + public double getAttributeAmmount(Attribute attribute) + { + return this.nbt.getAttributeAmmount(attribute); + } + + public Set getAttributes() + { + return this.nbt.getAttributes(); + } + + public void setCustomName(String name) + { + this.nbt.setCustomName(name); + } + + @Nullable + public MutableStringTextComponent getCustomName() + { + return this.nbt.getCustomName(); + } + + public void setPassenger(int index, String name) + { + this.nbt.setPassenger(index, BuilderEntity.parseEntityName(name)); + } + + public void setPassenger(int index, EntityNBT entity) + { + this.nbt.setPassenger(index, entity); + } + + public void setPassenger(int index, ResourceLocation id) + { + this.setPassenger(index, new EntityNBT(id)); + } + + public void addPassenger(EntityNBT entity) + { + this.nbt.addPassenger(entity); + } + + public void addPassenger(int index, EntityNBT entity) + { + this.nbt.addPassenger(index, entity); + } + + public void removePassenger(int index) + { + this.nbt.removePassenger(index); + } + + public int getPassengerCount() + { + return this.nbt.getPassengerCount(); + } + + public List getPassengers() + { + return this.nbt.getPassengers(); + } + + @Nullable + public EntityNBT getPassenger(int index) + { + return this.nbt.getPassenger(index); + } + + public boolean hasPassengers() + { + return this.nbt.hasPassengers(); + } + + public void setArmorItem(int index, Block block) + { + this.nbt.setArmorItem(index, block); + } + + public void setArmorItem(int index, Item item) + { + this.nbt.setArmorItem(index, item); + } + + public void setArmorItem(int index, ResourceLocation location) + { + this.nbt.setArmorItem(index, location); + } + + public void setArmorItems(ResourceLocation[] armor) + { + this.nbt.setArmorItems(armor); + } + + public ResourceLocation getArmorItem(int slot) + { + return this.nbt.getArmorItem(slot); + } + + public void setHandItem(int index, Block block) + { + this.nbt.setHandItem(index, block); + } + + public void setHandItem(int index, Item item) + { + this.nbt.setHandItem(index, item); + } + + public void setHandItem(int index, ResourceLocation location) + { + this.nbt.setHandItem(index, location); + } + + public ResourceLocation getHandItem(int slot) + { + return this.nbt.getHandItem(slot); + } + + public double[] getMotion() + { + return this.nbt.getMotion(); + } + + public void setMotion(double x, double y, double z) + { + this.nbt.setMotion(x, y, z); + } + + public double getMotionX() + { + return this.nbt.getMotionX(); + } + + public double getMotionY() + { + return this.nbt.getMotionY(); + } + + public double getMotionZ() + { + return this.nbt.getMotionZ(); + } + + public void setMotionX(double x) + { + this.nbt.setMotionX(x); + } + + public void setMotionY(double y) + { + this.nbt.setMotionY(y); + } + + public void setMotionZ(double z) + { + this.nbt.setMotionZ(z); + } + + public void setAmplifier(Effect potion, byte amplifier) + { + this.nbt.setAmplifier(potion, amplifier); + } + + public void setSeconds(Effect potion, int seconds) + { + this.nbt.setSeconds(potion, seconds); + } + + public void setMinutes(Effect potion, int minutes) + { + this.nbt.setMinutes(potion, minutes); + } + + public void setHours(Effect potion, int hours) + { + this.nbt.setHours(potion, hours); + } + + public void setShowParticles(Effect potion, boolean showParticles) + { + this.nbt.setShowParticles(potion, showParticles); + } + + public void setAmbient(Effect potion, boolean ambient) + { + this.nbt.setAmbient(potion, ambient); + } + + public byte getAmplifier(Effect potion) + { + return this.nbt.getAmplifier(potion); + } + + public int getSeconds(Effect potion) + { + return this.nbt.getSeconds(potion); + } + + public int getMinutes(Effect potion) + { + return this.nbt.getMinutes(potion); + } + + public int getHours(Effect potion) + { + return this.nbt.getHours(potion); + } + + public boolean getShowParticles(Effect potion) + { + return this.nbt.getShowParticles(potion); + } + + public boolean getAmbient(Effect potion) + { + return this.nbt.getAmbient(potion); + } + + public Set getEffects() + { + return this.nbt.getEffects(); + } + + public void setBlockState(BlockState blockState) + { + this.nbt.setBlockState(blockState); + } + + public BlockState getBlockState() + { + return this.nbt.getBlockState(); + } + + public void setTime(int time) + { + this.nbt.setTime(time); + } + + public int getTime() + { + return this.nbt.getTime(); + } + + public void setCommand(String command) + { + this.nbt.setCommand(command); + } + + public String getCommand() + { + return this.nbt.getCommand(); + } + + public void setEntityNBT(String nbt) + { + this.nbt.setNBT(nbt); + } + + public void setEntityNBT(CompoundNBT nbt) + { + this.nbt.setNBT(nbt); + } + + public CompoundNBT getEntityNBT() + { + return this.nbt.getNBT(); + } + + @Override + protected CompoundNBT buildNBT() + { + return this.nbt.serialize(); + } + + private void updateCustomComponent(String name) + { + ResourceLocation entity = this.getEntity(); + + if(name != null && entity != null) + { + if(entity.equals(EntityType.CAT.getRegistryName())) + { + this.nbt.setCustomComponent("CatType", IntNBT.valueOf(new Random().nextInt(11))); + } + else if(entity.equals(EntityType.VILLAGER.getRegistryName())) + { + for(VillagerProfession profession : ForgeRegistries.PROFESSIONS) + { + if(StringUtils.equalsIgnoreCase(name, profession.toString())) + { + CompoundNBT villagerData = new CompoundNBT(); + villagerData.putString("profession", profession.getRegistryName().toString()); + + this.nbt.setCustomComponent("VillagerData", villagerData); + break; + } + } + } + else if(entity.equals(EntityType.ZOMBIE.getRegistryName())) + { + if(StringUtils.containsIgnoreCase(name, "Baby")) + { + this.nbt.setCustomComponent("IsBaby", ByteNBT.valueOf((byte) 1)); + } + } + else if(entity.equals(EntityType.CHICKEN.getRegistryName())) + { + if(StringUtils.containsIgnoreCase(name, "Jockey") && !this.nbt.hasPassengers()) + { + ListNBT list = new ListNBT(); + EntityNBT zombie = new EntityNBT(EntityType.ZOMBIE.getRegistryName()); + + zombie.setIsBaby(true); + list.add(zombie.serialize()); + this.nbt.setCustomComponent("Passengers", list); + } + } + else if(entity.equals(EntityType.SPIDER.getRegistryName())) + { + if(StringUtils.containsIgnoreCase(name, "Jockey") && !this.nbt.hasPassengers()) + { + ListNBT list = new ListNBT(); + EntityNBT skeleton = new EntityNBT(EntityType.SKELETON.getRegistryName()); + + skeleton.setHandItem(0, Items.BOW); + list.add(skeleton.serialize()); + + this.nbt.setCustomComponent("Passengers", list); + } + } + else + { + this.nbt.resetCustomComponent(); + } + } + else + { + this.nbt.resetCustomComponent(); + } + } + + @Nullable + public static ResourceLocation parseEntityName(String entityName) + { + String name = ResourceHelper.stripToResourceLocation(entityName); + + if(name == null || name.isEmpty()) + { + return null; + } + + for(EntityType type : ForgeRegistries.ENTITIES.getValues()) + { + if(type.isSummonable() && entityName.equalsIgnoreCase(I18n.format(type.getTranslationKey()))) + { + return type.getRegistryName(); + } + } + + String entity = name.replaceAll("_", ""); + + if("RedCow".equalsIgnoreCase(entity)) + { + return EntityType.MOOSHROOM.getRegistryName(); + } + else if("ChickenJockey".equalsIgnoreCase(entity)) + { + return EntityType.CHICKEN.getRegistryName(); + } + else if("Pigman".equalsIgnoreCase(entity) || "ZombiePig".equalsIgnoreCase(entity) || "ZombiePigman".equalsIgnoreCase(entity)) + { + return EntityType.PIGLIN.getRegistryName(); + } + else if("Dog".equalsIgnoreCase(entity)) + { + return EntityType.WOLF.getRegistryName(); + } + else if("Dragon".equalsIgnoreCase(entity)) + { + return EntityType.ENDER_DRAGON.getRegistryName(); + } + else if("SnowMan".equalsIgnoreCase(entity)) + { + return EntityType.SNOW_GOLEM.getRegistryName(); + } + else if("LavaCube".equalsIgnoreCase(entity)|| "MagmaSlime".equalsIgnoreCase(entity) || "LavaSlime".equalsIgnoreCase(entity)) + { + return EntityType.MAGMA_CUBE.getRegistryName(); + } + else if("SpiderJockey".equalsIgnoreCase(entity)) + { + return EntityType.SPIDER.getRegistryName(); + } + else if("VillagerGolem".equalsIgnoreCase(entity)) + { + return EntityType.IRON_GOLEM.getRegistryName(); + } + else if("Ozelot".equalsIgnoreCase(entity)) + { + return EntityType.OCELOT.getRegistryName(); + } + else if("Kitty".equalsIgnoreCase(entity) || "Kitten".equalsIgnoreCase(entity)) + { + return EntityType.CAT.getRegistryName(); + } + else if("TESTIFICATE".equalsIgnoreCase(entity) || ForgeRegistries.PROFESSIONS.getKeys().stream().anyMatch(profession -> profession.getPath().equalsIgnoreCase(entity))) + { + return EntityType.VILLAGER.getRegistryName(); + } + else if("Octopus".equalsIgnoreCase(entity) || "Kraken".equalsIgnoreCase(entity)) + { + return EntityType.SQUID.getRegistryName(); + } + else if("Exwife".equalsIgnoreCase(entity)) + { + return EntityType.GHAST.getRegistryName(); + } + else if("CommandMinecart".equalsIgnoreCase(entity)) + { + return EntityType.COMMAND_BLOCK_MINECART.getRegistryName(); + } + else if("Wizard".equalsIgnoreCase(entity)) + { + return EntityType.EVOKER.getRegistryName(); + } + else if("Johnny".equalsIgnoreCase(entity)) + { + return EntityType.VINDICATOR.getRegistryName(); + } + else if("BabyZombie".equalsIgnoreCase(entity)) + { + return EntityType.ZOMBIE.getRegistryName(); + } + + return ResourceHelper.stringToResourceLocation(name); + } +} diff --git a/src/main/java/exopandora/worldhandler/builder/impl/BuilderSummon.java b/src/main/java/exopandora/worldhandler/builder/impl/BuilderSummon.java index ac04846..0231640 100644 --- a/src/main/java/exopandora/worldhandler/builder/impl/BuilderSummon.java +++ b/src/main/java/exopandora/worldhandler/builder/impl/BuilderSummon.java @@ -1,44 +1,17 @@ package exopandora.worldhandler.builder.impl; -import java.util.List; -import java.util.Random; -import java.util.Set; - -import javax.annotation.Nullable; - -import org.apache.commons.lang3.StringUtils; - -import exopandora.worldhandler.builder.CommandBuilderNBT; import exopandora.worldhandler.builder.CommandSyntax; -import exopandora.worldhandler.builder.component.impl.EntityNBT; import exopandora.worldhandler.builder.types.ArgumentType; import exopandora.worldhandler.builder.types.Coordinate.EnumType; import exopandora.worldhandler.builder.types.CoordinateDouble; -import exopandora.worldhandler.util.MutableStringTextComponent; -import exopandora.worldhandler.util.ResourceHelper; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.ai.attributes.Attribute; -import net.minecraft.entity.merchant.villager.VillagerProfession; -import net.minecraft.item.Item; -import net.minecraft.item.Items; -import net.minecraft.nbt.ByteNBT; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.nbt.IntNBT; -import net.minecraft.nbt.ListNBT; -import net.minecraft.potion.Effect; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.registries.ForgeRegistries; @OnlyIn(Dist.CLIENT) -public class BuilderSummon extends CommandBuilderNBT +public class BuilderSummon extends BuilderEntity { - private final EntityNBT nbt = new EntityNBT(); - public BuilderSummon() { this.setX(new CoordinateDouble(0.0, EnumType.LOCAL)); @@ -46,18 +19,6 @@ public class BuilderSummon extends CommandBuilderNBT this.setZ(new CoordinateDouble(2.0, EnumType.LOCAL)); } - public void setName(String name) - { - this.setEntity(BuilderSummon.parseEntityName(name)); - this.updateCustomComponent(name); - } - - public void setNameAndId(String name) - { - this.setName(name); - this.nbt.setId(this.getEntity()); - } - public void setEntity(ResourceLocation entity) { this.setNode(0, entity); @@ -98,284 +59,6 @@ public class BuilderSummon extends CommandBuilderNBT return this.getNodeAsCoordinateDouble(3); } - public void setId(ResourceLocation resource) - { - this.nbt.setId(resource); - } - - public ResourceLocation getId() - { - return this.nbt.getId(); - } - - public void setAttribute(Attribute attribute, double ammount) - { - this.nbt.setAttribute(attribute, ammount); - } - - public void removeAttribute(Attribute attribute) - { - this.nbt.removeAttribute(attribute); - } - - public double getAttributeAmmount(Attribute attribute) - { - return this.nbt.getAttributeAmmount(attribute); - } - - public Set getAttributes() - { - return this.nbt.getAttributes(); - } - - public void setCustomName(String name) - { - this.nbt.setCustomName(name); - } - - @Nullable - public MutableStringTextComponent getCustomName() - { - return this.nbt.getCustomName(); - } - - public void setPassenger(int index, String name) - { - this.nbt.setPassenger(index, BuilderSummon.parseEntityName(name)); - } - - public void setPassenger(int index, EntityNBT entity) - { - this.nbt.setPassenger(index, entity); - } - - public void setPassenger(int index, ResourceLocation id) - { - this.setPassenger(index, new EntityNBT(id)); - } - - public void addPassenger(EntityNBT entity) - { - this.nbt.addPassenger(entity); - } - - public void addPassenger(int index, EntityNBT entity) - { - this.nbt.addPassenger(index, entity); - } - - public void removePassenger(int index) - { - this.nbt.removePassenger(index); - } - - public int getPassengerCount() - { - return this.nbt.getPassengerCount(); - } - - public List getPassengers() - { - return this.nbt.getPassengers(); - } - - @Nullable - public EntityNBT getPassenger(int index) - { - return this.nbt.getPassenger(index); - } - - public boolean hasPassengers() - { - return this.nbt.hasPassengers(); - } - - public void setArmorItem(int index, Block block) - { - this.nbt.setArmorItem(index, block); - } - - public void setArmorItem(int index, Item item) - { - this.nbt.setArmorItem(index, item); - } - - public void setArmorItem(int index, ResourceLocation location) - { - this.nbt.setArmorItem(index, location); - } - - public void setArmorItems(ResourceLocation[] armor) - { - this.nbt.setArmorItems(armor); - } - - public ResourceLocation getArmorItem(int slot) - { - return this.nbt.getArmorItem(slot); - } - - public void setHandItem(int index, Block block) - { - this.nbt.setHandItem(index, block); - } - - public void setHandItem(int index, Item item) - { - this.nbt.setHandItem(index, item); - } - - public void setHandItem(int index, ResourceLocation location) - { - this.nbt.setHandItem(index, location); - } - - public ResourceLocation getHandItem(int slot) - { - return this.nbt.getHandItem(slot); - } - - public double[] getMotion() - { - return this.nbt.getMotion(); - } - - public void setMotion(double x, double y, double z) - { - this.nbt.setMotion(x, y, z); - } - - public double getMotionX() - { - return this.nbt.getMotionX(); - } - - public double getMotionY() - { - return this.nbt.getMotionY(); - } - - public double getMotionZ() - { - return this.nbt.getMotionZ(); - } - - public void setMotionX(double x) - { - this.nbt.setMotionX(x); - } - - public void setMotionY(double y) - { - this.nbt.setMotionY(y); - } - - public void setMotionZ(double z) - { - this.nbt.setMotionZ(z); - } - - public void setAmplifier(Effect potion, byte amplifier) - { - this.nbt.setAmplifier(potion, amplifier); - } - - public void setSeconds(Effect potion, int seconds) - { - this.nbt.setSeconds(potion, seconds); - } - - public void setMinutes(Effect potion, int minutes) - { - this.nbt.setMinutes(potion, minutes); - } - - public void setHours(Effect potion, int hours) - { - this.nbt.setHours(potion, hours); - } - - public void setShowParticles(Effect potion, boolean showParticles) - { - this.nbt.setShowParticles(potion, showParticles); - } - - public void setAmbient(Effect potion, boolean ambient) - { - this.nbt.setAmbient(potion, ambient); - } - - public byte getAmplifier(Effect potion) - { - return this.nbt.getAmplifier(potion); - } - - public int getSeconds(Effect potion) - { - return this.nbt.getSeconds(potion); - } - - public int getMinutes(Effect potion) - { - return this.nbt.getMinutes(potion); - } - - public int getHours(Effect potion) - { - return this.nbt.getHours(potion); - } - - public boolean getShowParticles(Effect potion) - { - return this.nbt.getShowParticles(potion); - } - - public boolean getAmbient(Effect potion) - { - return this.nbt.getAmbient(potion); - } - - public Set getEffects() - { - return this.nbt.getEffects(); - } - - public void setBlockState(BlockState blockState) - { - this.nbt.setBlockState(blockState); - } - - public BlockState getBlockState() - { - return this.nbt.getBlockState(); - } - - public void setTime(int time) - { - this.nbt.setTime(time); - } - - public int getTime() - { - return this.nbt.getTime(); - } - - public void setCommand(String command) - { - this.nbt.setCommand(command); - } - - public String getCommand() - { - return this.nbt.getCommand(); - } - - @Override - protected CompoundNBT buildNBT() - { - return this.nbt.serialize(); - } - @Override public void setNBT(CompoundNBT nbt) { @@ -401,167 +84,4 @@ public class BuilderSummon extends CommandBuilderNBT return syntax; } - - private void updateCustomComponent(String name) - { - ResourceLocation entity = this.getEntity(); - - if(name != null && entity != null) - { - if(entity.equals(EntityType.CAT.getRegistryName())) - { - this.nbt.setCustomComponent("CatType", IntNBT.valueOf(new Random().nextInt(11))); - } - else if(entity.equals(EntityType.VILLAGER.getRegistryName())) - { - for(VillagerProfession profession : ForgeRegistries.PROFESSIONS) - { - if(StringUtils.equalsIgnoreCase(name, profession.toString())) - { - CompoundNBT villagerData = new CompoundNBT(); - villagerData.putString("profession", profession.getRegistryName().toString()); - - this.nbt.setCustomComponent("VillagerData", villagerData); - break; - } - } - } - else if(entity.equals(EntityType.ZOMBIE.getRegistryName())) - { - if(StringUtils.containsIgnoreCase(name, "Baby")) - { - this.nbt.setCustomComponent("IsBaby", ByteNBT.valueOf((byte) 1)); - } - } - else if(entity.equals(EntityType.CHICKEN.getRegistryName())) - { - if(StringUtils.containsIgnoreCase(name, "Jockey") && !this.nbt.hasPassengers()) - { - ListNBT list = new ListNBT(); - EntityNBT zombie = new EntityNBT(EntityType.ZOMBIE.getRegistryName()); - - zombie.setIsBaby(true); - list.add(zombie.serialize()); - this.nbt.setCustomComponent("Passengers", list); - } - } - else if(entity.equals(EntityType.SPIDER.getRegistryName())) - { - if(StringUtils.containsIgnoreCase(name, "Jockey") && !this.nbt.hasPassengers()) - { - ListNBT list = new ListNBT(); - EntityNBT skeleton = new EntityNBT(EntityType.SKELETON.getRegistryName()); - - skeleton.setHandItem(0, Items.BOW); - list.add(skeleton.serialize()); - - this.nbt.setCustomComponent("Passengers", list); - } - } - else - { - this.nbt.resetCustomComponent(); - } - } - else - { - this.nbt.resetCustomComponent(); - } - } - - @Nullable - public static ResourceLocation parseEntityName(String entityName) - { - String name = ResourceHelper.stripToResourceLocation(entityName); - - if(name == null || name.isEmpty()) - { - return null; - } - - for(EntityType type : ForgeRegistries.ENTITIES.getValues()) - { - if(type.isSummonable() && entityName.equalsIgnoreCase(I18n.format(type.getTranslationKey()))) - { - return type.getRegistryName(); - } - } - - String entity = name.replaceAll("_", ""); - - if("RedCow".equalsIgnoreCase(entity)) - { - return EntityType.MOOSHROOM.getRegistryName(); - } - else if("ChickenJockey".equalsIgnoreCase(entity)) - { - return EntityType.CHICKEN.getRegistryName(); - } - else if("Pigman".equalsIgnoreCase(entity) || "ZombiePig".equalsIgnoreCase(entity) || "ZombiePigman".equalsIgnoreCase(entity)) - { - return EntityType.PIGLIN.getRegistryName(); - } - else if("Dog".equalsIgnoreCase(entity)) - { - return EntityType.WOLF.getRegistryName(); - } - else if("Dragon".equalsIgnoreCase(entity)) - { - return EntityType.ENDER_DRAGON.getRegistryName(); - } - else if("SnowMan".equalsIgnoreCase(entity)) - { - return EntityType.SNOW_GOLEM.getRegistryName(); - } - else if("LavaCube".equalsIgnoreCase(entity)|| "MagmaSlime".equalsIgnoreCase(entity) || "LavaSlime".equalsIgnoreCase(entity)) - { - return EntityType.MAGMA_CUBE.getRegistryName(); - } - else if("SpiderJockey".equalsIgnoreCase(entity)) - { - return EntityType.SPIDER.getRegistryName(); - } - else if("VillagerGolem".equalsIgnoreCase(entity)) - { - return EntityType.IRON_GOLEM.getRegistryName(); - } - else if("Ozelot".equalsIgnoreCase(entity)) - { - return EntityType.OCELOT.getRegistryName(); - } - else if("Kitty".equalsIgnoreCase(entity) || "Kitten".equalsIgnoreCase(entity)) - { - return EntityType.CAT.getRegistryName(); - } - else if("TESTIFICATE".equalsIgnoreCase(entity) || ForgeRegistries.PROFESSIONS.getKeys().stream().anyMatch(profession -> profession.getPath().equalsIgnoreCase(entity))) - { - return EntityType.VILLAGER.getRegistryName(); - } - else if("Octopus".equalsIgnoreCase(entity) || "Kraken".equalsIgnoreCase(entity)) - { - return EntityType.SQUID.getRegistryName(); - } - else if("Exwife".equalsIgnoreCase(entity)) - { - return EntityType.GHAST.getRegistryName(); - } - else if("CommandMinecart".equalsIgnoreCase(entity)) - { - return EntityType.COMMAND_BLOCK_MINECART.getRegistryName(); - } - else if("Wizard".equalsIgnoreCase(entity)) - { - return EntityType.EVOKER.getRegistryName(); - } - else if("Johnny".equalsIgnoreCase(entity)) - { - return EntityType.VINDICATOR.getRegistryName(); - } - else if("BabyZombie".equalsIgnoreCase(entity)) - { - return EntityType.ZOMBIE.getRegistryName(); - } - - return ResourceHelper.stringToResourceLocation(name); - } } diff --git a/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSignEditor.java b/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSignEditor.java index 0cc9631..adf9947 100644 --- a/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSignEditor.java +++ b/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSignEditor.java @@ -132,7 +132,7 @@ public class ContentSignEditor extends Content if(this.editColor) { - container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.done"), () -> this.toggleEditColor(container))); + container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.done"), () -> this.toggleEditColor(container))); } else { diff --git a/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSummon.java b/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSummon.java index 27363dc..a4a7100 100644 --- a/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSummon.java +++ b/src/main/java/exopandora/worldhandler/gui/content/impl/ContentSummon.java @@ -17,7 +17,9 @@ import exopandora.worldhandler.gui.category.Category; import exopandora.worldhandler.gui.container.Container; import exopandora.worldhandler.gui.content.Content; import exopandora.worldhandler.gui.content.Contents; +import exopandora.worldhandler.gui.menu.impl.ILogicColorMenu; import exopandora.worldhandler.gui.menu.impl.ILogicPageList; +import exopandora.worldhandler.gui.menu.impl.MenuColorField; import exopandora.worldhandler.gui.menu.impl.MenuPageList; import exopandora.worldhandler.gui.widget.button.EnumIcon; import exopandora.worldhandler.gui.widget.button.GuiButtonBase; @@ -51,16 +53,14 @@ import net.minecraftforge.registries.ForgeRegistries; public class ContentSummon extends Content { private GuiTextFieldTooltip mobField; - private GuiTextFieldTooltip customNameField; - private GuiTextFieldTooltip passengerField; + private GuiTextFieldTooltip nbtField; private int potionPage = 0; + private boolean editColor; private Page page = Page.START; - private String mob; - private String name; - private String passenger; + private String nbt; private final BuilderSummon builderSummon = new BuilderSummon(); @@ -157,7 +157,7 @@ public class ContentSummon extends Content @Override public void initGui(Container container, int x, int y) { - this.mobField = new GuiTextFieldTooltip(x + 118, y, 114, 20, new StringTextComponent(I18n.format("gui.worldhandler.entities.summon.start.mob_id") + " (" + I18n.format("gui.worldhandler.generic.name") + ")")); + this.mobField = new GuiTextFieldTooltip(x + 118, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start.mob_id")); this.mobField.setValidator(Predicates.notNull()); this.mobField.setText(this.mob); this.mobField.setResponder(text -> @@ -167,27 +167,42 @@ public class ContentSummon extends Content container.initButtons(); }); - this.customNameField = new GuiTextFieldTooltip(x + 118, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start.custom_name")); - this.customNameField.setValidator(Predicates.notNull()); - this.customNameField.setText(this.name); - this.customNameField.setResponder(text -> + this.nbtField = new GuiTextFieldTooltip(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start.custom_nbt")); + this.nbtField.setValidator(Predicates.notNull()); + this.nbtField.setText(this.nbt); + this.nbtField.setResponder(text -> { - this.name = text; - this.builderSummon.setCustomName(this.name); + this.nbt = text; + this.builderSummon.setEntityNBT(this.nbt); container.initButtons(); }); - this.passengerField = new GuiTextFieldTooltip(x + 118, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start.passenger_mob_id")); - this.passengerField.setValidator(Predicates.notNull()); - this.passengerField.setText(this.passenger); - this.passengerField.setResponder(text -> + if(Page.START.equals(this.page)) { - this.passenger = this.passengerField.getText(); - this.builderSummon.setPassenger(0, this.passenger); - container.initButtons(); - }); - - if(Page.ATTRIBUTES.equals(this.page)) + MenuColorField customName = new MenuColorField(x, y, "gui.worldhandler.entities.summon.start.custom_name", this.builderSummon.getCustomName(), new ILogicColorMenu() + { + @Override + public boolean doDrawButtons() + { + return ContentSummon.this.editColor; + } + + @Override + public boolean doDrawTextField() + { + return ContentSummon.this.editColor; + } + + @Override + public String getId() + { + return "custom_name"; + } + }); + + container.add(customName); + } + else if(Page.ATTRIBUTES.equals(this.page)) { MenuPageList attributes = new MenuPageList(x + 118, y, ComponentAttribute.ATTRIBUTES, 114, 20, 3, container, new ILogicPageList() { @@ -246,48 +261,39 @@ public class ContentSummon extends Content GuiButtonBase button6; GuiButtonBase button7; - container.add(new GuiButtonBase(x, y + 96, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.back"), () -> ActionHelper.back(this))); - container.add(new GuiButtonBase(x + 118, y + 96, 114, 20, new TranslationTextComponent("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame)); + container.add(new GuiButtonBase(x, y + 96, 114, 20, "gui.worldhandler.generic.back", () -> ActionHelper.back(this))); + container.add(new GuiButtonBase(x + 118, y + 96, 114, 20, "gui.worldhandler.generic.backToGame", ActionHelper::backToGame)); - container.add(button4 = new GuiButtonBase(x, y, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.start"), () -> - { - this.page = Page.START; - container.init(); - })); - container.add(button5 = new GuiButtonBase(x, y + 24, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.potion_effects"), () -> - { - this.page = Page.POTIONS; - container.init(); - })); - container.add(button6 = new GuiButtonBase(x, y + 48, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.attributes"), () -> - { - this.page = Page.ATTRIBUTES; - container.init(); - })); - container.add(button7 = new GuiButtonBase(x, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.entities.summon.equipment"), () -> - { - this.page = Page.EQUIPMENT; - container.init(); - })); + container.add(button4 = new GuiButtonBase(x, y, 114, 20, "gui.worldhandler.entities.summon.start", () -> this.changePage(container, Page.START))); + container.add(button5 = new GuiButtonBase(x, y + 24, 114, 20, "gui.worldhandler.entities.summon.potion_effects", () -> this.changePage(container, Page.POTIONS))); + container.add(button6 = new GuiButtonBase(x, y + 48, 114, 20, "gui.worldhandler.entities.summon.attributes", () -> this.changePage(container, Page.ATTRIBUTES))); + container.add(button7 = new GuiButtonBase(x, y + 72, 114, 20, "gui.worldhandler.entities.summon.equipment", () -> this.changePage(container, Page.EQUIPMENT))); if(Page.START.equals(this.page)) { button4.active = false; - container.add(this.mobField); - container.add(this.customNameField); - container.add(this.passengerField); - - if(!this.builderSummon.needsCommandBlock() && !this.builderSummon.getCustomName().isSpecial()) + if(this.editColor) { - container.add(button3 = new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.title.entities.summon"), () -> this.send(container.getPlayer()))); + container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, "gui.worldhandler.generic.done", () -> this.toggleEditColor(container))); } else { - container.add(button3 = new GuiButtonBase(x + 118, y + 72, 114, 20, new TranslationTextComponent("gui.worldhandler.actions.place_command_block"), () -> this.send(container.getPlayer()))); + container.add(this.mobField); + container.add(new GuiButtonBase(x + 118, y + 24, 114, 20, "gui.worldhandler.entities.summon.start.custom_name", () -> this.toggleEditColor(container))); + container.add(this.nbtField); + + if(!this.builderSummon.needsCommandBlock() && !this.builderSummon.getCustomName().isSpecial()) + { + container.add(button3 = new GuiButtonBase(x + 118, y + 72, 114, 20, "gui.worldhandler.title.entities.summon", () -> this.send(container.getPlayer()))); + } + else + { + container.add(button3 = new GuiButtonBase(x + 118, y + 72, 114, 20, "gui.worldhandler.actions.place_command_block", () -> this.send(container.getPlayer()))); + } + + button3.active = ForgeRegistries.ENTITIES.containsKey(this.builderSummon.getEntity()); } - - button3.active = ForgeRegistries.ENTITIES.containsKey(this.builderSummon.getEntity()); } else if(Page.POTIONS.equals(this.page)) { @@ -306,7 +312,7 @@ public class ContentSummon extends Content int count = 0; - for(ResourceLocation location : this.getSortedPotionList()) + for(ResourceLocation location : this.sortedPotions()) { Effect potion = ForgeRegistries.POTIONS.getValue(location); @@ -402,9 +408,11 @@ public class ContentSummon extends Content { if(Page.START.equals(this.page)) { - this.mobField.tick(); - this.customNameField.tick(); - this.passengerField.tick(); + if(!this.editColor) + { + this.mobField.tick(); + this.nbtField.tick(); + } } } @@ -413,9 +421,11 @@ public class ContentSummon extends Content { if(Page.START.equals(this.page)) { - this.mobField.renderButton(matrix, mouseX, mouseY, partialTicks); - this.customNameField.renderButton(matrix, mouseX, mouseY, partialTicks); - this.passengerField.renderButton(matrix, mouseX, mouseY, partialTicks); + if(!this.editColor) + { + this.mobField.renderButton(matrix, mouseX, mouseY, partialTicks); + this.nbtField.renderButton(matrix, mouseX, mouseY, partialTicks); + } } else if(Page.POTIONS.equals(this.page)) { @@ -445,13 +455,25 @@ public class ContentSummon extends Content } } - private List getSortedPotionList() + private List sortedPotions() { return ForgeRegistries.POTIONS.getKeys().stream() .sorted((a, b) -> I18n.format(ForgeRegistries.POTIONS.getValue(a).getName()).compareTo(I18n.format(ForgeRegistries.POTIONS.getValue(b).getName()))) .collect(Collectors.toList()); } + private void toggleEditColor(Container container) + { + this.editColor = !this.editColor; + container.init(); + } + + private void changePage(Container container, Page page) + { + this.page = page; + container.init(); + } + @Override public Category getCategory() { diff --git a/src/main/java/exopandora/worldhandler/gui/menu/impl/ILogicColorMenu.java b/src/main/java/exopandora/worldhandler/gui/menu/impl/ILogicColorMenu.java index 2ffbd67..030e63f 100644 --- a/src/main/java/exopandora/worldhandler/gui/menu/impl/ILogicColorMenu.java +++ b/src/main/java/exopandora/worldhandler/gui/menu/impl/ILogicColorMenu.java @@ -17,6 +17,11 @@ public interface ILogicColorMenu extends ILogic return true; } + default boolean doDrawTextField() + { + return true; + } + @Override default String getId() { diff --git a/src/main/java/exopandora/worldhandler/gui/menu/impl/MenuColorField.java b/src/main/java/exopandora/worldhandler/gui/menu/impl/MenuColorField.java index 1ab89b1..5700e27 100644 --- a/src/main/java/exopandora/worldhandler/gui/menu/impl/MenuColorField.java +++ b/src/main/java/exopandora/worldhandler/gui/menu/impl/MenuColorField.java @@ -79,7 +79,10 @@ public class MenuColorField extends Menu @Override public void initButtons(Container container) { - container.add(this.textField); + if(this.logic.doDrawTextField()) + { + container.add(this.textField); + } if(this.logic.doDrawButtons()) { @@ -147,12 +150,18 @@ public class MenuColorField extends Menu @Override public void tick() { - this.textField.tick(); + if(this.logic.doDrawTextField()) + { + this.textField.tick(); + } } @Override public void draw(MatrixStack matrix, int mouseX, int mouseY, float partialTicks) { - this.textField.renderButton(matrix, mouseX, mouseY, partialTicks); + if(this.logic.doDrawTextField()) + { + this.textField.renderButton(matrix, mouseX, mouseY, partialTicks); + } } } diff --git a/src/main/resources/assets/worldhandler/lang/de_de.json b/src/main/resources/assets/worldhandler/lang/de_de.json index 96eb9ce..3169d4a 100644 --- a/src/main/resources/assets/worldhandler/lang/de_de.json +++ b/src/main/resources/assets/worldhandler/lang/de_de.json @@ -198,7 +198,6 @@ "gui.worldhandler.blocks.sign_editor.text_line_3": "Textzeile III", "gui.worldhandler.blocks.sign_editor.text_line_4": "Textzeile IV", "gui.worldhandler.blocks.sign_editor.commmand": "Befehl", - "gui.worldhandler.blocks.sign_editor.done": "Fertig", "gui.worldhandler.blocks.sign_editor.format_text_line": "Textzeile formatieren", "gui.worldhandler.blocks.note_block_editor.look_at_note_block": "Gucke auf einen Notenblock und drücke '%s'", @@ -323,9 +322,9 @@ "gui.worldhandler.entities.summon.attributes": "Attribute", "gui.worldhandler.entities.summon.equipment": "Ausrüstung", - "gui.worldhandler.entities.summon.start.mob_id": "Tier ID", - "gui.worldhandler.entities.summon.start.custom_name": "Eigener Name", - "gui.worldhandler.entities.summon.start.passenger_mob_id": "Passagier Tier ID", + "gui.worldhandler.entities.summon.start.mob_id": "Name oder ID des Wesens", + "gui.worldhandler.entities.summon.start.custom_name": "Name des Wesens", + "gui.worldhandler.entities.summon.start.custom_nbt": "NBT des Wesens", "gui.worldhandler.potion.time.hours": "Stunden", "gui.worldhandler.potion.time.minutes": "Minuten", @@ -366,10 +365,10 @@ "gui.worldhandler.generic.yes": "Ja", "gui.worldhandler.generic.no": "Nein", "gui.worldhandler.generic.value": "Wert", - "gui.worldhandler.generic.name": "Name", "gui.worldhandler.generic.enable": "Ein", "gui.worldhandler.generic.disable": "Aus", "gui.worldhandler.generic.edit_username": "Benutzername", + "gui.worldhandler.generic.done": "Fertig", "gui.worldhandler.actions.add": "Hinzufügen", "gui.worldhandler.actions.remove": "Entfernen", diff --git a/src/main/resources/assets/worldhandler/lang/en_us.json b/src/main/resources/assets/worldhandler/lang/en_us.json index e0049de..c3cdb88 100644 --- a/src/main/resources/assets/worldhandler/lang/en_us.json +++ b/src/main/resources/assets/worldhandler/lang/en_us.json @@ -198,7 +198,6 @@ "gui.worldhandler.blocks.sign_editor.text_line_3": "Text Line III", "gui.worldhandler.blocks.sign_editor.text_line_4": "Text Line IV", "gui.worldhandler.blocks.sign_editor.commmand": "Command", - "gui.worldhandler.blocks.sign_editor.done": "Done", "gui.worldhandler.blocks.sign_editor.format_text_line": "Format Text Line", "gui.worldhandler.blocks.note_block_editor.look_at_note_block": "Look at a Note Block and press '%s'", @@ -323,9 +322,9 @@ "gui.worldhandler.entities.summon.attributes": "Attributes", "gui.worldhandler.entities.summon.equipment": "Equipment", - "gui.worldhandler.entities.summon.start.mob_id": "Mob ID", + "gui.worldhandler.entities.summon.start.mob_id": "Mob ID or Name", "gui.worldhandler.entities.summon.start.custom_name": "Custom Name", - "gui.worldhandler.entities.summon.start.passenger_mob_id": "Passenger Mob ID", + "gui.worldhandler.entities.summon.start.custom_nbt": "Custom NBT", "gui.worldhandler.potion.time.hours": "Hours", "gui.worldhandler.potion.time.minutes": "Minutes", @@ -366,10 +365,10 @@ "gui.worldhandler.generic.yes": "Yes", "gui.worldhandler.generic.no": "No", "gui.worldhandler.generic.value": "Value", - "gui.worldhandler.generic.name": "Name", "gui.worldhandler.generic.enable": "Enable", "gui.worldhandler.generic.disable": "Disable", "gui.worldhandler.generic.edit_username": "Edit Username", + "gui.worldhandler.generic.done": "Done", "gui.worldhandler.actions.add": "Add", "gui.worldhandler.actions.remove": "Remove", diff --git a/src/main/resources/assets/worldhandler/lang/fr_fr.json b/src/main/resources/assets/worldhandler/lang/fr_fr.json index c4d749a..0055756 100644 --- a/src/main/resources/assets/worldhandler/lang/fr_fr.json +++ b/src/main/resources/assets/worldhandler/lang/fr_fr.json @@ -198,7 +198,6 @@ "gui.worldhandler.blocks.sign_editor.text_line_3": "Ligne de texte III", "gui.worldhandler.blocks.sign_editor.text_line_4": "Ligne de texte IV", "gui.worldhandler.blocks.sign_editor.commmand": "Commande", - "gui.worldhandler.blocks.sign_editor.done": "Terminé", "gui.worldhandler.blocks.sign_editor.format_text_line": "Format ligne de texte", "gui.worldhandler.blocks.note_block_editor.look_at_note_block": "Regardez un bloc musical et appuyez sur '%s'", @@ -326,7 +325,7 @@ "gui.worldhandler.entities.summon.start.mob_id": "ID de créature", "gui.worldhandler.entities.summon.start.custom_name": "Nom personnalisé", - "gui.worldhandler.entities.summon.start.passenger_mob_id": "ID créature passager", + "gui.worldhandler.entities.summon.start.custom_nbt": "Custom NBT", "gui.worldhandler.potion.time.hours": "Heures ", "gui.worldhandler.potion.time.minutes": "Minutes ", @@ -367,10 +366,10 @@ "gui.worldhandler.generic.yes": "Oui", "gui.worldhandler.generic.no": "Non", "gui.worldhandler.generic.value": "Valeur", - "gui.worldhandler.generic.name": "Nom", "gui.worldhandler.generic.enable": "Activer", "gui.worldhandler.generic.disable": "Désactiver", "gui.worldhandler.generic.edit_username": "Modifier le nom d'utilisateur", + "gui.worldhandler.generic.done": "Terminé", "gui.worldhandler.actions.add": "Ajouter", "gui.worldhandler.actions.remove": "Supprimer", diff --git a/src/main/resources/assets/worldhandler/lang/ru_ru.json b/src/main/resources/assets/worldhandler/lang/ru_ru.json index 164b87e..75e99b5 100644 --- a/src/main/resources/assets/worldhandler/lang/ru_ru.json +++ b/src/main/resources/assets/worldhandler/lang/ru_ru.json @@ -198,7 +198,6 @@ "gui.worldhandler.blocks.sign_editor.text_line_3": "Текстовая строка III", "gui.worldhandler.blocks.sign_editor.text_line_4": "Текстовая строка IV", "gui.worldhandler.blocks.sign_editor.commmand": "Команда", - "gui.worldhandler.blocks.sign_editor.done": "Готово", "gui.worldhandler.blocks.sign_editor.format_text_line": "Формат текстовой строки", "gui.worldhandler.blocks.note_block_editor.look_at_note_block": "Посмотрите на заметки блоков и нажмите '%s'", @@ -325,7 +324,7 @@ "gui.worldhandler.entities.summon.start.mob_id": "ID моба", "gui.worldhandler.entities.summon.start.custom_name": "Пользовательское имя", - "gui.worldhandler.entities.summon.start.passenger_mob_id": "ID пассажирского моба", + "gui.worldhandler.entities.summon.start.custom_nbt": "Custom NBT", "gui.worldhandler.potion.time.hours": "Часов", "gui.worldhandler.potion.time.minutes": "Минут", @@ -366,10 +365,10 @@ "gui.worldhandler.generic.yes": "Да", "gui.worldhandler.generic.no": "Нет", "gui.worldhandler.generic.value": "Значение", - "gui.worldhandler.generic.name": "Имя", "gui.worldhandler.generic.enable": "Включить", "gui.worldhandler.generic.disable": "Выключить", "gui.worldhandler.generic.edit_username": "Изменить имя пользователя", + "gui.worldhandler.generic.done": "Готово", "gui.worldhandler.actions.add": "Добавить", "gui.worldhandler.actions.remove": "Удалить", diff --git a/src/main/resources/assets/worldhandler/lang/zh_cn.json b/src/main/resources/assets/worldhandler/lang/zh_cn.json index 0419f07..1972c9c 100644 --- a/src/main/resources/assets/worldhandler/lang/zh_cn.json +++ b/src/main/resources/assets/worldhandler/lang/zh_cn.json @@ -199,7 +199,6 @@ "gui.worldhandler.blocks.sign_editor.text_line_3": "文字行 III", "gui.worldhandler.blocks.sign_editor.text_line_4": "文字行 IV", "gui.worldhandler.blocks.sign_editor.commmand": "命令", - "gui.worldhandler.blocks.sign_editor.done": "完成", "gui.worldhandler.blocks.sign_editor.format_text_line": "文本行格式", "gui.worldhandler.blocks.note_block_editor.look_at_note_block": "看着一个音符盒并按 '%s'", @@ -326,7 +325,7 @@ "gui.worldhandler.entities.summon.start.mob_id": "生物 ID", "gui.worldhandler.entities.summon.start.custom_name": "自定义名称", - "gui.worldhandler.entities.summon.start.passenger_mob_id": "骑乘生物 ID", + "gui.worldhandler.entities.summon.start.custom_nbt": "Custom NBT", "gui.worldhandler.potion.time.hours": "小时", "gui.worldhandler.potion.time.minutes": "分钟", @@ -367,10 +366,10 @@ "gui.worldhandler.generic.yes": "是", "gui.worldhandler.generic.no": "否", "gui.worldhandler.generic.value": "值", - "gui.worldhandler.generic.name": "名称", "gui.worldhandler.generic.enable": "开启", "gui.worldhandler.generic.disable": "关闭", "gui.worldhandler.generic.edit_username": "编辑用户名", + "gui.worldhandler.generic.done": "完成", "gui.worldhandler.actions.add": "添加", "gui.worldhandler.actions.remove": "删除",