本文整理汇总了Java中net.minecraft.entity.EntityList.getTranslationName方法的典型用法代码示例。如果您正苦于以下问题:Java EntityList.getTranslationName方法的具体用法?Java EntityList.getTranslationName怎么用?Java EntityList.getTranslationName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityList
的用法示例。
在下文中一共展示了EntityList.getTranslationName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addInformation
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> list, ITooltipFlag advanced)
{
if (stack.hasTagCompound())
{
NBTTagCompound chestTile = stack.getTagCompound().getCompoundTag("ChestTile");
NBTTagCompound spawnData = chestTile.getCompoundTag("SpawnData");
String mobId = spawnData.getString("id");
if (mobId.length() > 0)
{
String translated = EntityList.getTranslationName(new ResourceLocation(mobId));
list.add(translated == null ? mobId : translated);
}
}
}
示例2: addInformation
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
@Override
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, tooltip, flagIn);
if (containsEntity(stack) && EntityList.getTranslationName(new ResourceLocation(getID(stack))) != null) {
tooltip.add("Mob: " + new TextComponentTranslation(EntityList.getTranslationName(new ResourceLocation(getID(stack)))).getUnformattedComponentText());
tooltip.add("Health: " + stack.getTagCompound().getDouble("Health"));
if (BlockRegistry.mobDuplicatorBlock.blacklistedEntities.contains(stack.getTagCompound().getString("entity")))
tooltip.add(TextFormatting.RED + "Entity blacklisted in the Mob Duplicator");
}
}
示例3: getItemStackDisplayName
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
@Override
public String getItemStackDisplayName(ItemStack stack) {
if (!containsEntity(stack))
return new TextComponentTranslation(super.getUnlocalizedName(stack) + ".name").getUnformattedComponentText();
return new TextComponentTranslation(super.getUnlocalizedName(stack) + ".name").getUnformattedComponentText() + " (" + EntityList.getTranslationName(new ResourceLocation(getID(stack))) + ")";
}