Java 类net.minecraft.util.text.translation.I18n 实例源码

项目:CustomWorldGen    文件:ItemSkull.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 3 && stack.hasTagCompound())
    {
        if (stack.getTagCompound().hasKey("SkullOwner", 8))
        {
            return I18n.translateToLocalFormatted("item.skull.player.name", new Object[] {stack.getTagCompound().getString("SkullOwner")});
        }

        if (stack.getTagCompound().hasKey("SkullOwner", 10))
        {
            NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("SkullOwner");

            if (nbttagcompound.hasKey("Name", 8))
            {
                return I18n.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")});
            }
        }
    }

    return super.getItemStackDisplayName(stack);
}
项目:GeneralLaymansAestheticSpyingScreen    文件:GuiProjectorSetter.java   
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    if(mc == null)
    {
        mc = Minecraft.getMinecraft();
        fontRenderer = mc.fontRenderer;
    }
    drawDefaultBackground();

    GlStateManager.color(1F, 1F, 1F, 1F);
    this.mc.getTextureManager().bindTexture(texBackground);
    this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

    trackList.drawScreen(mouseX, mouseY, partialTicks);

    super.drawScreen(mouseX, mouseY, partialTicks);

    GlStateManager.pushMatrix();
    GlStateManager.scale(0.5F, 0.5F, 0.5F);
    fontRenderer.drawString(I18n.translateToLocal("glass.gui.availableProjectors"), (guiLeft + 5) / 0.5F, (guiTop + 5) / 0.5F, 16777215, true);
    GlStateManager.popMatrix();
}
项目:GeneralLaymansAestheticSpyingScreen    文件:GuiChannelList.java   
@Override
protected void drawSlot(int idx, int right, int top, int height, Tessellator tess)
{
    if(idx >= 0 && idx < channels.size())
    {
        FontRenderer font = this.parent.getFontRenderer();
        String channel = channels.get(idx);
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.5F, 0.5F, 1F);
        String name = font.trimStringToWidth(channel.substring(channel.indexOf(":") + 1), (listWidth - 10) * 2);
        if(channel.startsWith("public:"))
        {
            name = I18n.translateToLocal("glass.gui.public") + " " + name;
        }
        font.drawString(name, (this.left + 2) * 2, top * 2, idx % 2 == 0 ? 0xFFFFFF : 0xAAAAAA);
        GlStateManager.popMatrix();
    }
}
项目:Mods    文件:DamageSourceProjectile.java   
/**
 * Returns the message to be displayed on player death.
 */
@Override
public ITextComponent getDeathMessage(EntityLivingBase p_151519_1_) {
    // ItemStack itemstack = this.damageSourceEntity instanceof
    // EntityLivingBase ?
    // ((EntityLivingBase)this.damageSourceEntity).getHeldItem(EnumHand.MAIN_HAND)
    // : null;
    if (this.getTrueSource() == TF2weapons.dummyEnt)
        return new TextComponentTranslation("death.attack.explosion", p_151519_1_.getDisplayName());
    String s = "death.attack." + this.damageType;
    String s1 = s + ".item";
    return weapon != null && I18n.canTranslate(s1)
            ? new TextComponentTranslation(s1,
                    new Object[] { p_151519_1_.getDisplayName(), this.getTrueSource().getDisplayName(),
                            weapon.getDisplayName() })
            : new TextComponentTranslation(s,
                    new Object[] { p_151519_1_.getDisplayName(), this.getTrueSource().getDisplayName() });
}
项目:CombinedPotions    文件:RecipeCombinedPotions2.java   
@Override
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    ItemStack outputStack = ItemStack.EMPTY;
    if (countSlotsNotEmpty(inv) <= 1) return outputStack;

    Collection<PotionEffect> effects = new ArrayList<PotionEffect>();

    for (int i = 0; i < inv.getSizeInventory(); i++)
    {
        ItemStack stack = inv.getStackInSlot(i);
        if (!stack.isEmpty())
        {
            if (outputStack.isEmpty()) outputStack = getOutputStack(stack);
            if (outputStack.isEmpty()) return outputStack;

            effects.addAll(getEffectsFromStack(stack));
        }
    }

    outputStack = PotionUtils.appendEffects(outputStack, effects);
    outputStack.setStackDisplayName(I18n.translateToLocal("item.combined_" + outputStack.getItem().getUnlocalizedName().substring(5) + ".name"));

    return outputStack;
}
项目:Mods    文件:ItemBuildingBox.java   
@Override
@SuppressWarnings("deprecation")
public String getItemStackDisplayName(ItemStack p_77653_1_) {
    // (I18n.translateToLocal(this.getUnlocalizedName()+".name")).trim();
    int i = p_77653_1_.getItemDamage() / 2;
    String s1 = "sentry";
    switch (i) {
    case 10:
        s1 = "dispenser";
        break;
    case 11:
        s1 = "teleporter";
        break;
    }
    return I18n.translateToLocal(this.getUnlocalizedName() + "." + s1 + ".name");
}
项目:CustomWorldGen    文件:ItemWrittenBook.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    if (stack.hasTagCompound())
    {
        NBTTagCompound nbttagcompound = stack.getTagCompound();
        String s = nbttagcompound.getString("author");

        if (!StringUtils.isNullOrEmpty(s))
        {
            tooltip.add(TextFormatting.GRAY + I18n.translateToLocalFormatted("book.byAuthor", new Object[] {s}));
        }

        tooltip.add(TextFormatting.GRAY + I18n.translateToLocal("book.generation." + nbttagcompound.getInteger("generation")));
    }
}
项目:Clef    文件:GuiPlayTrackBlock.java   
@Override
public void initGui()
{
    super.initGui();
    trackListBottom -= 22;
    trackList = new GuiTrackList(this, 158, ySize - 22, guiTop + 17, trackListBottom, guiLeft + 7, 8, playlistView ? playlist : tracks);

    this.mc.player.openContainer = this.containerInstrumentPlayer;

    for(GuiButton btn : buttonList)
    {
        if(btn.id == ID_CONFIRM)
        {
            btn.displayString = I18n.translateToLocal("gui.done");
        }
    }
}
项目:Clef    文件:GuiPlayTrackBlock.java   
@Override
public void addButtons()
{
    if(!playlistView)
    {
        super.addButtons();
        buttonList.add(new GuiButton(ID_ADD_PLAYLIST, guiLeft + 116 - 55, guiTop + 205, 50, 20, I18n.translateToLocal("clef.gui.block.addPlaylist")));
        buttonList.add(new GuiButton(ID_VIEW_PLAYLIST, guiLeft + 116, guiTop + 205, 50, 20, I18n.translateToLocal("clef.gui.block.viewPlaylist")));
    }
    else
    {
        buttonList.add(new GuiButton(ID_REPEAT, guiLeft + 179, guiTop + 51, 72, 20, I18n.translateToLocal(repeat == 0 ? "clef.gui.block.repeatNone" : repeat == 1 ? "clef.gui.block.repeatAll" :"clef.gui.block.repeatOne")));
        buttonList.add(new GuiButton(ID_SHUFFLE, guiLeft + 179, guiTop + 94, 72, 20, I18n.translateToLocal(shuffle == 1 ? "gui.yes" : "gui.no")));

        buttonList.add(new GuiButton(ID_VIEW_ALL, guiLeft + 116, guiTop + 205, 50, 20, I18n.translateToLocal("clef.gui.block.viewAll")));
        buttonList.add(new GuiButton(ID_ORDER_UP, guiLeft + 6, guiTop + 205, 20, 20, ""));
        buttonList.add(new GuiButton(ID_ORDER_DOWN, guiLeft + 30, guiTop + 205, 20, 20, ""));
        buttonList.add(new GuiButton(ID_DELETE, guiLeft + 54, guiTop + 205, 20, 20, ""));
    }
}
项目:Mods    文件:DamageSourceDirect.java   
/**
 * Returns the message to be displayed on player death.
 */
@Override
public ITextComponent getDeathMessage(EntityLivingBase p_151519_1_) {
    // ItemStack itemstack = this.damageSourceEntity instanceof
    // EntityLivingBase ?
    // ((EntityLivingBase)this.damageSourceEntity).getHeldItem(EnumHand.MAIN_HAND)
    // : null;
    String s = "death.attack." + this.damageType;
    String s1 = s + ".item";
    return !weapon.isEmpty() && I18n.canTranslate(s1)
            ? new TextComponentTranslation(s1,
                    new Object[] { p_151519_1_.getDisplayName(), this.getTrueSource().getDisplayName(),
                            weapon.getDisplayName() })
            : new TextComponentTranslation(s,
                    new Object[] { p_151519_1_.getDisplayName(), this.getTrueSource().getDisplayName() });
}
项目:customstuff4    文件:ItemFluidContainer.java   
@Override
@Nonnull
public String getItemStackDisplayName(@Nonnull ItemStack stack)
{
    FluidStack fluidStack = getFluid(stack);
    if (fluidStack == null)
    {
        return super.getItemStackDisplayName(stack);
    }

    String unloc = this.getUnlocalizedNameInefficiently(stack);

    if (I18n.canTranslate(unloc + "." + fluidStack.getFluid().getName()))
    {
        return I18n.translateToLocal(unloc + "." + fluidStack.getFluid().getName());
    }

    return I18n.translateToLocalFormatted(unloc + ".filled.name", fluidStack.getLocalizedName());
}
项目:CompositeGear    文件:ClientEventHandler.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent ev)
{
    ItemStack itemStack = ev.getItemStack();

    if (itemStack.getItem() instanceof IClassifiedItem)
    {
        IClassifiedItem classifiedItem = (IClassifiedItem)itemStack.getItem();
        String transItemClass = I18n.translateToLocal("compositegear.itemclass");

        ev.getToolTip().add(1, transItemClass + ": " + classifiedItem.getItemClass().getLocalized());

        if (itemStack.getItem() instanceof ItemCGArmor) {
            String transItemDesc = I18n.translateToLocal("compositegear.itemdesc");


            if (((ItemCGArmor)itemStack.getItem()).hasDescription()) {
                String descriptionString = I18n.translateToLocal(itemStack.getItem().getUnlocalizedName() + ".description");
                ev.getToolTip().add(2, transItemDesc + ": " + descriptionString);
            }
        }
    }
}
项目:Backmemed    文件:Entity.java   
/**
 * Get the name of this object. For players this returns their username
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        String s = EntityList.getEntityString(this);

        if (s == null)
        {
            s = "generic";
        }

        return I18n.translateToLocal("entity." + s + ".name");
    }
}
项目:Backmemed    文件:EntityRabbit.java   
public void setRabbitType(int rabbitTypeId)
{
    if (rabbitTypeId == 99)
    {
        this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0D);
        this.tasks.addTask(4, new EntityRabbit.AIEvilAttack(this));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, true));

        if (!this.hasCustomName())
        {
            this.setCustomNameTag(I18n.translateToLocal("entity.KillerBunny.name"));
        }
    }

    this.dataManager.set(RABBIT_TYPE, Integer.valueOf(rabbitTypeId));
}
项目:Backmemed    文件:ItemMonsterPlacer.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = ("" + I18n.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
    String s1 = EntityList.func_191302_a(func_190908_h(stack));

    if (s1 != null)
    {
        s = s + " " + I18n.translateToLocal("entity." + s1 + ".name");
    }

    return s;
}
项目:Soot    文件:ItemMug.java   
@Override
public String getItemStackDisplayName(ItemStack stack) {
    FluidStack fluid = FluidUtil.getFluidContained(stack);
    if(fluid != null)
        return I18n.translateToLocalFormatted("item.mug.name",fluid.getLocalizedName());
    else
        return I18n.translateToLocal("item.mug.empty.name");
}
项目:rtap    文件:ModDeath.java   
public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) {

       EntityLivingBase entitylivingbase = entityLivingBaseIn.getAttackingEntity();
       String s = "death.attack." + this.damageType;
       String s1 = s + ".player";
       return entitylivingbase != null && I18n.canTranslate(s1) ? new TextComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), entitylivingbase.getDisplayName()}) : new TextComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName()});

}
项目:harshencastle    文件:BaseBlockHarshenSingleInventory.java   
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{   
    BaseTileEntityHarshenSingleItemInventory te = (BaseTileEntityHarshenSingleItemInventory) worldIn.getTileEntity(pos);
    IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);

    if(!worldIn.isRemote)
        if(isBreakNBT(handler.getStackInSlot(0)))
        {
            ItemStackHandler handlerStack = new ItemStackHandler(1);
            handlerStack.setStackInSlot(0, handler.getStackInSlot(0));
            ItemStack stack = new ItemStack(this);
            String stackName = "";
            NBTTagCompound nbttagcompound = new NBTTagCompound();
            if(handlerStack.getStackInSlot(0).getItem() != Items.AIR)
            {
                nbttagcompound.setTag("ItemStackHandler", handlerStack.serializeNBT());
                stackName +=  I18n.translateToLocal(handlerStack.getStackInSlot(0).getItem().getUnlocalizedName() + ".name");
            }
            addNBT(handler.getStackInSlot(0), nbttagcompound, worldIn, pos);
            if(!nbttagcompound.getKeySet().isEmpty() || !handlerStack.getStackInSlot(0).isEmpty())
            {
                stack.setTagCompound(nbttagcompound);
                stackName += extraName(nbttagcompound, handlerStack.getStackInSlot(0).getItem() != Items.AIR);
                stackName = stackName.equals("")? "�r" + getLocalizedName() : "�r" + getLocalizedName() + " (" + stackName + ")";
                stack.setStackDisplayName(stackName);
            }
            if(!creativeBreakMap.containsKey(pos) || !creativeBreakMap.get(pos))
                worldIn.spawnEntity(new EntityItem(worldIn, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack));
            creativeBreakMap.remove(pos);
        }
        else
            InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), handler.getStackInSlot(0));
    super.breakBlock(worldIn, pos, state);
}
项目:Backmemed    文件:TextComponentTranslation.java   
@VisibleForTesting

    /**
     * ensures that our children are initialized from the most recent string translation mapping.
     */
    synchronized void ensureInitialized()
    {
        synchronized (this.syncLock)
        {
            long i = I18n.getLastTranslationUpdateTimeInMilliseconds();

            if (i == this.lastTranslationUpdateTimeInMilliseconds)
            {
                return;
            }

            this.lastTranslationUpdateTimeInMilliseconds = i;
            this.children.clear();
        }

        try
        {
            this.initializeFromFormat(I18n.translateToLocal(this.key));
        }
        catch (TextComponentTranslationFormatException textcomponenttranslationformatexception)
        {
            this.children.clear();

            try
            {
                this.initializeFromFormat(I18n.translateToFallback(this.key));
            }
            catch (TextComponentTranslationFormatException var5)
            {
                throw textcomponenttranslationformatexception;
            }
        }
    }
项目:GeneralLaymansAestheticSpyingScreen    文件:GuiChannelSetter.java   
@Override
    public void drawScreen(int mouseX, int mouseY, float partialTicks)
    {
//                initGui();
        if(mc == null)
        {
            mc = Minecraft.getMinecraft();
            fontRenderer = mc.fontRenderer;
        }
        drawDefaultBackground();

        GlStateManager.color(1F, 1F, 1F, 1F);
        this.mc.getTextureManager().bindTexture(texBackground);
        this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

        if(channelName.getVisible())
        {
            channelName.drawTextBox();
        }

        super.drawScreen(mouseX, mouseY, partialTicks);

        fontRenderer.drawString(I18n.translateToLocal("glass.gui.channelName"), guiLeft + 8, guiTop + 6, 16777215, true);

        fontRenderer.drawString(I18n.translateToLocal("glass.gui.publicChannel"), guiLeft + 8, guiTop + 37, 16777215, true);

    }
项目:GeneralLaymansAestheticSpyingScreen    文件:GuiChannelSetter.java   
@Override
protected void actionPerformed(GuiButton btn)
{
    if(btn.id == ID_PUBLIC_CHANNEL)
    {
        isPublicChannel = !isPublicChannel;
        btn.displayString = I18n.translateToLocal(isPublicChannel ? "gui.yes" : "gui.no");
    }
    else if(btn.id == ID_CONFIRM)
    {
        confirm();
    }
}
项目:Backmemed    文件:EntityDamageSourceIndirect.java   
/**
 * Gets the death message that is displayed when the player dies
 */
public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn)
{
    ITextComponent itextcomponent = this.indirectEntity == null ? this.damageSourceEntity.getDisplayName() : this.indirectEntity.getDisplayName();
    ItemStack itemstack = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItemMainhand() : ItemStack.field_190927_a;
    String s = "death.attack." + this.damageType;
    String s1 = s + ".item";
    return !itemstack.func_190926_b() && itemstack.hasDisplayName() && I18n.canTranslate(s1) ? new TextComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), itextcomponent, itemstack.getTextComponent()}): new TextComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName(), itextcomponent});
}
项目:CustomWorldGen    文件:EntityDamageSource.java   
/**
 * Gets the death message that is displayed when the player dies
 */
public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn)
{
    ItemStack itemstack = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItemMainhand() : null;
    String s = "death.attack." + this.damageType;
    String s1 = s + ".item";
    return itemstack != null && itemstack.hasDisplayName() && I18n.canTranslate(s1) ? new TextComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), this.damageSourceEntity.getDisplayName(), itemstack.getTextComponent()}): new TextComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName(), this.damageSourceEntity.getDisplayName()});
}
项目:CustomWorldGen    文件:ItemBanner.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = "item.banner.";
    EnumDyeColor enumdyecolor = getBaseColor(stack);
    s = s + enumdyecolor.getUnlocalizedName() + ".name";
    return I18n.translateToLocal(s);
}
项目:CustomWorldGen    文件:ItemMonsterPlacer.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = ("" + I18n.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
    String s1 = getEntityIdFromItem(stack);

    if (s1 != null)
    {
        s = s + " " + I18n.translateToLocal("entity." + s1 + ".name");
    }

    return s;
}
项目:Infernum    文件:ModelKnowledgeBook.java   
private static BakedModelKnowledgeBook rebake(ModelKnowledgeBook model, String name) {  
    Matrix4f m = new Matrix4f();
       m.m20 = 1f / 128f;
       m.m01 = m.m12 = -m.m20;
       m.m33 = 1;
       Matrix3f rotation = new Matrix3f();
       m.getRotationScale(rotation);
       Matrix3f angleZ = new Matrix3f();
       angleZ.rotZ(-1.5708F);
       rotation.mul(rotation, angleZ);
       m.setRotationScale(rotation);
       m.setScale(0.66666666667F * m.getScale());
       m.setTranslation(new Vector3f(0.1875F, 0.2505F, 0.125F));
    SimpleModelFontRenderer fontRenderer = new SimpleModelFontRenderer(Minecraft.getMinecraft().gameSettings, font, Minecraft.getMinecraft().getTextureManager(), false, m, DefaultVertexFormats.ITEM) {
        @Override
        protected float renderUnicodeChar(char c, boolean italic) {
            return super.renderDefaultChar(126, italic);
        }
    };
    int maxLineWidth = 96;
    TextureAtlasSprite fontSprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(font2.toString());
    List<BakedQuad> textQuads = new ArrayList<BakedQuad>();

    fontRenderer.setSprite(fontSprite);
       fontRenderer.setFillBlanks(false);

       int yOffset = 2;
       String title = I18n.translateToLocal(name);
       List<String> lines = fontRenderer.listFormattedStringToWidth(title, maxLineWidth);
       for (int line = 0; line < lines.size(); line++) {
        int offset = ((maxLineWidth - fontRenderer.getStringWidth(lines.get(line))) / 2);
        fontRenderer.drawString(lines.get(line), offset, yOffset, 0x00000000);
        yOffset += (fontRenderer.FONT_HEIGHT - 1 + 4);
       }

       textQuads.addAll(fontRenderer.build());
       return new BakedModelKnowledgeBook(model, textQuads);
}
项目:Infernum    文件:ItemSpellPage.java   
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
    if (!getSpell(stack).equals(Spell.EMPTY_SPELL)) {
        tooltip.add(TextFormatting.DARK_RED + "" + TextFormatting.ITALIC
                + I18n.translateToLocal(getSpell(stack).getUnlocalizedName() + ".name"));
    }
}
项目:Machines-and-Stuff    文件:GuiBase.java   
public GuiBase(Container container, TileEntity tile, EntityPlayer player, String name) {
    super(container);
    this.container = container;
    this.tile = tile;
    this.name = I18n.translateToLocal(name);
    this.player = player;
}
项目:Anima-Mundi    文件:TileEntityLinkableWorker.java   
@Override
@SideOnly(Side.CLIENT)
public void drawInformation(int startX, int startY)
{
    Minecraft mc = Minecraft.getMinecraft();
    ItemStack drawStack = new ItemStack(getBlockType());

    int dX = startX + 12;
    int dY = startY - 12;

    mc.getRenderItem().renderItemAndEffectIntoGUI(drawStack, dX, dY);
    dY += 5;
    mc.fontRenderer.drawString(getBlockType().getLocalizedName(), dX + 20, dY, 0xFFFFFF);
    dY += 16;

    boolean canSendPower = canSendEnergy();
    boolean canSendItems = canSendItems();

    String canPower = canSendPower ? "anima.info.cansendpower" : "anima.info.cannotsendpower";
    String canItems = canSendItems ? "anima.info.cansenditems" : "anima.info.cannotsenditems";
    int canPowerColour = canSendPower ? 0x00FF00 : 0xFF0000;
    int canItemColour = canSendItems ? 0x00FF00 : 0xFF0000;
    mc.fontRenderer.drawString(I18n.translateToLocal(canPower), dX, dY, canPowerColour);
    dY += 12;
    mc.fontRenderer.drawString(I18n.translateToLocal(canItems), dX, dY, canItemColour);
    dY += 12;
    mc.fontRenderer.drawString(I18n.translateToLocal("anima.info.storedpower") + " " + animaStorage.getEnergyStored(), dX, dY, 0x77af6e);
    dY += 12;
    mc.fontRenderer.drawString(I18n.translateToLocal("anima.info.maxpower") + " " + animaStorage.getMaxEnergyStored(), dX, dY, 0x77af6e);
    dY += 12;

    mc.fontRenderer.drawString(getLinkAmount() + "/" + getMaxLinks() + " " + I18n.translateToLocal("anima.info.links"), dX, dY, 0x4286f4);
}
项目:Adventurers-Toolbox    文件:ItemToolHead.java   
@Override
public String getItemStackDisplayName(ItemStack stack) {
    HeadMaterial mat = meta_map.get(stack.getMetadata());

    if (mat == null) {
        return super.getItemStackDisplayName(stack);
    }

    return I18n.translateToLocal(mat.getName() + ".name") + " " + super.getItemStackDisplayName(stack);
}
项目:Halloween    文件:EntityCurse.java   
public EntityCurse(World world, EntityLivingBase victim)
{
    super(world);

    this.lifetime = 1200;
    this.orbital = this.rand.nextFloat() * 360.0F;
    this.noClip = true;
    this.setSize(0.25F, 0.25F);

    this.victim = victim;
    if (this.victim == null)
    {
        this.setPosition(this.posX, this.posY, this.posZ);
    }
    else
    {
        if (!this.world.isRemote)
        {
            this.dataManager.set(VICTIM_ID, (this.victim == null ? 0 : this.victim.getEntityId()));
        }
        if (this.victim instanceof EntityPlayer)
        {
            ((EntityPlayer)this.victim).sendMessage(new TextComponentString(String.format(I18n.translateToLocal("chat.curse.struck"), this.getCurseType().getDisplayName())));
        }
        this.setPosition(this.victim.posX, this.victim.posY + this.victim.getEyeHeight(), this.victim.posZ);
    }
}
项目:mc-Slingshot    文件:DamageSourceEnderBall.java   
/**
 * Gets the death message that is displayed when the player dies
 */
@Override
public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn)
{
    ITextComponent itextcomponent = this.indirectEntity == null ? this.damageSourceEntity.getDisplayName() : this.indirectEntity.getDisplayName();
    ItemStack itemstack = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItemMainhand() : null;
    String s = "death.attack." + this.damageType;
    String s1 = s + ".item";
    return itemstack != null && itemstack.hasDisplayName() && I18n.canTranslate(s1) ? new TextComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), itextcomponent, itemstack.getTextComponent()}): new TextComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName(), itextcomponent});
}
项目:Mods    文件:ItemStatue.java   
public String getItemStackDisplayName(ItemStack stack)
  {
if(!stack.hasTagCompound())
    return super.getItemStackDisplayName(stack);
if(!stack.getTagCompound().getCompoundTag("Statue").getBoolean("Player"))
    return I18n.translateToLocal("entity." + EntityList.getTranslationName
            (new ResourceLocation(stack.getTagCompound().getCompoundTag("Statue").getCompoundTag("Entity").getString("id")))+".name")+" "+
            I18n.translateToLocal(this.getUnlocalizedName() + ".name");
else
    return I18n.translateToLocal(this.getUnlocalizedName() + ".player.name");
  }
项目:Clef    文件:GuiPlayTrack.java   
public void drawText()
{
    fontRenderer.drawString(I18n.translateToLocal("clef.gui.chooseSong") + " (" + tracks.size() + ")", guiLeft + 6, guiTop + 5, 16777215, true);
    fontRenderer.drawString(I18n.translateToLocal("clef.gui.syncPlayTime"), guiLeft + 179, guiTop + 40, 16777215, true);
    fontRenderer.drawString(I18n.translateToLocal("clef.gui.syncTrack"), guiLeft + 179, guiTop + 83, 16777215, true);
    GlStateManager.pushMatrix();
    int length = fontRenderer.getStringWidth(I18n.translateToLocal("clef.gui.moreSongs"));
    GlStateManager.translate(guiLeft - 4, guiTop + length + 3, 0);
    GlStateManager.scale(0.5F, 0.5F, 1F);
    GlStateManager.rotate(-90F, 0F, 0F, 1F);
    fontRenderer.drawString(I18n.translateToLocal("clef.gui.moreSongs"), 0, 0, 16777215, true);
    GlStateManager.popMatrix();
}
项目:Backmemed    文件:Enchantment.java   
/**
 * Returns the correct traslated name of the enchantment and the level in roman numbers.
 */
public String getTranslatedName(int level)
{
    String s = I18n.translateToLocal(this.getName());

    if (this.func_190936_d())
    {
        s = TextFormatting.RED + s;
    }

    return level == 1 && this.getMaxLevel() == 1 ? s : s + " " + I18n.translateToLocal("enchantment.level." + level);
}
项目:Clef    文件:GuiPlayTrackBlock.java   
@Override
public void drawText()
{
    if(!playlistView)
    {
        fontRenderer.drawString(I18n.translateToLocal("clef.gui.block.playlist") + ":", guiLeft + 9, guiTop + 211, 16777215, true);
        super.drawText();
    }
    else
    {
        fontRenderer.drawString(I18n.translateToLocal("clef.gui.block.playlist") + " (" + playlist.size() + ")", guiLeft + 6, guiTop + 5, 16777215, true);
        fontRenderer.drawString(I18n.translateToLocal("clef.gui.block.repeat"), guiLeft + 179, guiTop + 40, 16777215, true);
        fontRenderer.drawString(I18n.translateToLocal("clef.gui.block.shuffle"), guiLeft + 179, guiTop + 83, 16777215, true);
    }
}
项目:ItemZoom    文件:ItemZoomModConfigGui.java   
private static String getTitle() {
    String titleFormatKey = "config.itemzoom.title";
    String titleFormat;
    if (I18n.canTranslate(titleFormatKey)) {
        titleFormat = I18n.translateToLocal(titleFormatKey);
    } else {
        titleFormat = I18n.translateToFallback(titleFormatKey);
    }
    return titleFormat.replace("%MODNAME", ItemZoom.MOD_NAME);
}
项目:CustomWorldGen    文件:TextComponentTranslation.java   
@VisibleForTesting

    /**
     * ensures that our children are initialized from the most recent string translation mapping.
     */
    synchronized void ensureInitialized()
    {
        synchronized (this.syncLock)
        {
            long i = I18n.getLastTranslationUpdateTimeInMilliseconds();

            if (i == this.lastTranslationUpdateTimeInMilliseconds)
            {
                return;
            }

            this.lastTranslationUpdateTimeInMilliseconds = i;
            this.children.clear();
        }

        try
        {
            this.initializeFromFormat(I18n.translateToLocal(this.key));
        }
        catch (TextComponentTranslationFormatException textcomponenttranslationformatexception)
        {
            this.children.clear();

            try
            {
                this.initializeFromFormat(I18n.translateToFallback(this.key));
            }
            catch (TextComponentTranslationFormatException var5)
            {
                throw textcomponenttranslationformatexception;
            }
        }
    }
项目:Thermionics    文件:ItemChunkUnloader.java   
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
    tooltip.add(I18n.translateToLocal("item.thermionics.chunkunloader.tip"));
    int loadedState = stack.getItemDamage();
    switch(loadedState) {
    default: //Default to unattuned

    case 0: tooltip.add(I18n.translateToLocalFormatted("thermionics.data.chunkunloader.unattuned")); break;
    case 1: tooltip.add(I18n.translateToLocalFormatted("thermionics.data.chunkunloader.unloaded")); break;
    case 2: tooltip.add(I18n.translateToLocalFormatted("thermionics.data.chunkunloader.loaded")); break;
    }
}
项目:Backmemed    文件:EntityDamageSource.java   
/**
 * Gets the death message that is displayed when the player dies
 */
public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn)
{
    ItemStack itemstack = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItemMainhand() : ItemStack.field_190927_a;
    String s = "death.attack." + this.damageType;
    String s1 = s + ".item";
    return !itemstack.func_190926_b() && itemstack.hasDisplayName() && I18n.canTranslate(s1) ? new TextComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), this.damageSourceEntity.getDisplayName(), itemstack.getTextComponent()}): new TextComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName(), this.damageSourceEntity.getDisplayName()});
}