本文整理匯總了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))) + ")";
}