Java 类net.minecraft.util.StatCollector 实例源码

项目:DecompiledMinecraft    文件:Entity.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        String s = EntityList.getEntityString(this);

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

        return StatCollector.translateToLocal("entity." + s + ".name");
    }
}
项目:DecompiledMinecraft    文件:EntityRabbit.java   
public void setRabbitType(int rabbitTypeId)
{
    if (rabbitTypeId == 99)
    {
        this.tasks.removeTask(this.aiAvoidWolves);
        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(StatCollector.translateToLocal("entity.KillerBunny.name"));
        }
    }

    this.dataWatcher.updateObject(18, Byte.valueOf((byte)rabbitTypeId));
}
项目:DecompiledMinecraft    文件:ItemSkull.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 3 && stack.hasTagCompound())
    {
        if (stack.getTagCompound().hasKey("SkullOwner", 8))
        {
            return StatCollector.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 StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")});
            }
        }
    }

    return super.getItemStackDisplayName(stack);
}
项目:DecompiledMinecraft    文件:Entity.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        String s = EntityList.getEntityString(this);

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

        return StatCollector.translateToLocal("entity." + s + ".name");
    }
}
项目:DecompiledMinecraft    文件:EntityRabbit.java   
public void setRabbitType(int rabbitTypeId)
{
    if (rabbitTypeId == 99)
    {
        this.tasks.removeTask(this.aiAvoidWolves);
        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(StatCollector.translateToLocal("entity.KillerBunny.name"));
        }
    }

    this.dataWatcher.updateObject(18, Byte.valueOf((byte)rabbitTypeId));
}
项目:DecompiledMinecraft    文件:ItemSkull.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 3 && stack.hasTagCompound())
    {
        if (stack.getTagCompound().hasKey("SkullOwner", 8))
        {
            return StatCollector.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 StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")});
            }
        }
    }

    return super.getItemStackDisplayName(stack);
}
项目:DecompiledMinecraft    文件:ItemBanner.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);

    if (nbttagcompound != null && nbttagcompound.hasKey("Patterns"))
    {
        NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10);

        for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i)
        {
            NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
            EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color"));
            TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));

            if (tileentitybanner$enumbannerpattern != null)
            {
                tooltip.add(StatCollector.translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + enumdyecolor.getUnlocalizedName()));
            }
        }
    }
}
项目:DecompiledMinecraft    文件:ItemEditableBook.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
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(EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {s}));
        }

        tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("book.generation." + nbttagcompound.getInteger("generation")));
    }
}
项目:BaseClient    文件:ItemSkull.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 3 && stack.hasTagCompound())
    {
        if (stack.getTagCompound().hasKey("SkullOwner", 8))
        {
            return StatCollector.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 StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")});
            }
        }
    }

    return super.getItemStackDisplayName(stack);
}
项目:connor41-etfuturum2    文件:ItemBanner.java   
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) {
    NBTTagCompound nbttagcompound = getSubTag(stack, "BlockEntityTag", false);

    if (nbttagcompound != null && nbttagcompound.hasKey("Patterns")) {
        NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10);

        for (int i = 0; i < nbttaglist.tagCount() && i < 6; i++) {
            NBTTagCompound nbt = nbttaglist.getCompoundTagAt(i);
            EnumColour colour = EnumColour.fromDamage(nbt.getInteger("Color"));
            EnumBannerPattern pattern = EnumBannerPattern.getPatternByID(nbt.getString("Pattern"));

            if (pattern != null)
                tooltip.add(StatCollector.translateToLocal("item.banner." + pattern.getPatternName() + "." + colour.getMojangName()));
        }
    }
}
项目:BaseClient    文件:ItemBanner.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);

    if (nbttagcompound != null && nbttagcompound.hasKey("Patterns"))
    {
        NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10);

        for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i)
        {
            NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
            EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color"));
            TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));

            if (tileentitybanner$enumbannerpattern != null)
            {
                tooltip.add(StatCollector.translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + enumdyecolor.getUnlocalizedName()));
            }
        }
    }
}
项目:BaseClient    文件:Entity.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        String s = EntityList.getEntityString(this);

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

        return StatCollector.translateToLocal("entity." + s + ".name");
    }
}
项目:BaseClient    文件:EntityRabbit.java   
public void setRabbitType(int rabbitTypeId)
{
    if (rabbitTypeId == 99)
    {
        this.tasks.removeTask(this.aiAvoidWolves);
        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(StatCollector.translateToLocal("entity.KillerBunny.name"));
        }
    }

    this.dataWatcher.updateObject(18, Byte.valueOf((byte)rabbitTypeId));
}
项目:BaseClient    文件:ItemSkull.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 3 && stack.hasTagCompound())
    {
        if (stack.getTagCompound().hasKey("SkullOwner", 8))
        {
            return StatCollector.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 StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")});
            }
        }
    }

    return super.getItemStackDisplayName(stack);
}
项目:BaseClient    文件:ItemBanner.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);

    if (nbttagcompound != null && nbttagcompound.hasKey("Patterns"))
    {
        NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10);

        for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i)
        {
            NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
            EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color"));
            TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));

            if (tileentitybanner$enumbannerpattern != null)
            {
                tooltip.add(StatCollector.translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + enumdyecolor.getUnlocalizedName()));
            }
        }
    }
}
项目:BaseClient    文件:Entity.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        String s = EntityList.getEntityString(this);

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

        return StatCollector.translateToLocal("entity." + s + ".name");
    }
}
项目:nei-lotr    文件:ModVersion.java   
public IChatComponent getFormattedChatText() {
    String text = StatCollector.translateToLocal("neiLotr.versionChecker.notification.chat");
    String[] parts = text.split("7");
    String text1 = parts[0];
    String text2 = parts[1];
    String text3 = parts[2];
    String text4 = parts[3];

    ChatComponentText chat1 = (ChatComponentText) new ChatComponentText("[NEI LOTR]: ")
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN));
    ChatComponentText chat2 = (ChatComponentText) new ChatComponentText(text1 + " ")
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));
    ChatComponentText chat3 = (ChatComponentText) new ChatComponentText(text2)
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.BLUE).setUnderlined(true)
                    .setChatClickEvent(
                            new ClickEvent(Action.OPEN_URL, "https://goo.gl/EkxFlC"))
                    .setChatHoverEvent(
                            new HoverEvent(net.minecraft.event.HoverEvent.Action.SHOW_TEXT,
                                    new ChatComponentText(StatCollector
                                            .translateToLocal("neiLotr.versionChecker.notification.changelog")
                                            .replace("/", "\n")))));
    ChatComponentText chat4 = (ChatComponentText) new ChatComponentText(" " + text3 + " ")
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));
    ChatComponentText chat5 = (ChatComponentText) new ChatComponentText(state.toString() + " " + version)
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW).setUnderlined(true)
                    .setChatClickEvent(
                            new ClickEvent(Action.OPEN_URL, url))
                    .setChatHoverEvent(
                            new HoverEvent(net.minecraft.event.HoverEvent.Action.SHOW_TEXT,
                                    new ChatComponentText(StatCollector
                                            .translateToLocal("neiLotr.versionChecker.notification.newVersion")
                                            .replace("/", "\n")))));
    ChatComponentText chat6 = (ChatComponentText) new ChatComponentText(" " + text4 + " ")
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));
    ChatComponentText chat7 = (ChatComponentText) new ChatComponentText(mcVersion)
            .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));

    return chat1.appendSibling(chat2).appendSibling(chat3).appendSibling(chat4).appendSibling(chat5)
            .appendSibling(chat6).appendSibling(chat7);
}
项目:nei-lotr    文件:NeiLotrNEIConfig.java   
private void addOverrideNames() {
    // Portals
    setOverrideName(LOTRMod.elvenPortal, StatCollector.translateToLocal("lotrNei.lotr.block.elvenPortal.name"));
    setOverrideName(LOTRMod.morgulPortal, StatCollector.translateToLocal("lotrNei.lotr.block.morgulPortal.name"));
    setOverrideName(LOTRMod.utumnoPortal, StatCollector.translateToLocal("lotrNei.lotr.block.utumnoPortal.name"));
    setOverrideName(LOTRMod.utumnoReturnPortal,
            StatCollector.translateToLocal("lotrNei.lotr.block.utumnoReturnPortal.name"));
    setOverrideName(LOTRMod.utumnoReturnPortalBase,
            StatCollector.translateToLocal("lotrNei.lotr.block.utumnoReturnPortalBase.name"));

    // Others
    setOverrideName(LOTRMod.goran, StatCollector.translateToLocal("lotrNei.lotr.block.goranBlock.name"));
    setOverrideName(LOTRMod.rhunFire, StatCollector.translateToLocal("lotrNei.lotr.block.rhunFire.name"));
}
项目:BaseClient    文件:ItemMonsterPlacer.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
    String s1 = EntityList.getStringFromID(stack.getMetadata());

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

    return s;
}
项目:BaseClient    文件:ItemFirework.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    if (stack.hasTagCompound())
    {
        NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("Fireworks");

        if (nbttagcompound != null)
        {
            if (nbttagcompound.hasKey("Flight", 99))
            {
                tooltip.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + nbttagcompound.getByte("Flight"));
            }

            NBTTagList nbttaglist = nbttagcompound.getTagList("Explosions", 10);

            if (nbttaglist != null && nbttaglist.tagCount() > 0)
            {
                for (int i = 0; i < nbttaglist.tagCount(); ++i)
                {
                    NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
                    List<String> list = Lists.<String>newArrayList();
                    ItemFireworkCharge.addExplosionInfo(nbttagcompound1, list);

                    if (list.size() > 0)
                    {
                        for (int j = 1; j < ((List)list).size(); ++j)
                        {
                            list.set(j, "  " + (String)list.get(j));
                        }

                        tooltip.addAll(list);
                    }
                }
            }
        }
    }
}
项目:nei-lotr    文件:BasicTradeHandler.java   
public BasicTradeHandler(long id, String traderNameRaw, LOTRTradeEntries entriesBuy, LOTRTradeEntries entriesSell) {
    super(id);
    this.traderName = StatCollector.translateToLocal(traderNameRaw);
    this.traderNameRaw = traderNameRaw;
    this.entriesBuy = entriesBuy;
    this.entriesSell = entriesSell;
    this.vesselsBuy = NeiLotrReflection.getDrinkVessels(entriesBuy);
    this.vesselsSell = NeiLotrReflection.getDrinkVessels(entriesSell);
}
项目:BaseClient    文件:EntityHorse.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        int i = this.getHorseType();

        switch (i)
        {
            case 0:
            default:
                return StatCollector.translateToLocal("entity.horse.name");

            case 1:
                return StatCollector.translateToLocal("entity.donkey.name");

            case 2:
                return StatCollector.translateToLocal("entity.mule.name");

            case 3:
                return StatCollector.translateToLocal("entity.zombiehorse.name");

            case 4:
                return StatCollector.translateToLocal("entity.skeletonhorse.name");
        }
    }
}
项目:DecompiledMinecraft    文件:EntityHorse.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        int i = this.getHorseType();

        switch (i)
        {
            case 0:
            default:
                return StatCollector.translateToLocal("entity.horse.name");

            case 1:
                return StatCollector.translateToLocal("entity.donkey.name");

            case 2:
                return StatCollector.translateToLocal("entity.mule.name");

            case 3:
                return StatCollector.translateToLocal("entity.zombiehorse.name");

            case 4:
                return StatCollector.translateToLocal("entity.skeletonhorse.name");
        }
    }
}
项目:DecompiledMinecraft    文件:ItemBanner.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = "item.banner.";
    EnumDyeColor enumdyecolor = this.getBaseColor(stack);
    s = s + enumdyecolor.getUnlocalizedName() + ".name";
    return StatCollector.translateToLocal(s);
}
项目:DecompiledMinecraft    文件:ItemMonsterPlacer.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
    String s1 = EntityList.getStringFromID(stack.getMetadata());

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

    return s;
}
项目:BaseClient    文件:ItemPotion.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 0)
    {
        return StatCollector.translateToLocal("item.emptyPotion.name").trim();
    }
    else
    {
        String s = "";

        if (isSplash(stack.getMetadata()))
        {
            s = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " ";
        }

        List<PotionEffect> list = Items.potionitem.getEffects(stack);

        if (list != null && !list.isEmpty())
        {
            String s2 = ((PotionEffect)list.get(0)).getEffectName();
            s2 = s2 + ".postfix";
            return s + StatCollector.translateToLocal(s2).trim();
        }
        else
        {
            String s1 = PotionHelper.getPotionPrefix(stack.getMetadata());
            return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(stack);
        }
    }
}
项目:DecompiledMinecraft    文件:EntityHorse.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        int i = this.getHorseType();

        switch (i)
        {
            case 0:
            default:
                return StatCollector.translateToLocal("entity.horse.name");

            case 1:
                return StatCollector.translateToLocal("entity.donkey.name");

            case 2:
                return StatCollector.translateToLocal("entity.mule.name");

            case 3:
                return StatCollector.translateToLocal("entity.zombiehorse.name");

            case 4:
                return StatCollector.translateToLocal("entity.skeletonhorse.name");
        }
    }
}
项目:DecompiledMinecraft    文件:ItemPotion.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 0)
    {
        return StatCollector.translateToLocal("item.emptyPotion.name").trim();
    }
    else
    {
        String s = "";

        if (isSplash(stack.getMetadata()))
        {
            s = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " ";
        }

        List<PotionEffect> list = Items.potionitem.getEffects(stack);

        if (list != null && !list.isEmpty())
        {
            String s2 = ((PotionEffect)list.get(0)).getEffectName();
            s2 = s2 + ".postfix";
            return s + StatCollector.translateToLocal(s2).trim();
        }
        else
        {
            String s1 = PotionHelper.getPotionPrefix(stack.getMetadata());
            return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(stack);
        }
    }
}
项目:DecompiledMinecraft    文件:ItemFirework.java   
/**
 * allows items to add custom lines of information to the mouseover description
 */
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    if (stack.hasTagCompound())
    {
        NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("Fireworks");

        if (nbttagcompound != null)
        {
            if (nbttagcompound.hasKey("Flight", 99))
            {
                tooltip.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + nbttagcompound.getByte("Flight"));
            }

            NBTTagList nbttaglist = nbttagcompound.getTagList("Explosions", 10);

            if (nbttaglist != null && nbttaglist.tagCount() > 0)
            {
                for (int i = 0; i < nbttaglist.tagCount(); ++i)
                {
                    NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
                    List<String> list = Lists.<String>newArrayList();
                    ItemFireworkCharge.addExplosionInfo(nbttagcompound1, list);

                    if (list.size() > 0)
                    {
                        for (int j = 1; j < ((List)list).size(); ++j)
                        {
                            list.set(j, "  " + (String)list.get(j));
                        }

                        tooltip.addAll(list);
                    }
                }
            }
        }
    }
}
项目:BaseClient    文件:EntityHorse.java   
/**
 * Gets the name of this command sender (usually username, but possibly "Rcon")
 */
public String getName()
{
    if (this.hasCustomName())
    {
        return this.getCustomNameTag();
    }
    else
    {
        int i = this.getHorseType();

        switch (i)
        {
            case 0:
            default:
                return StatCollector.translateToLocal("entity.horse.name");

            case 1:
                return StatCollector.translateToLocal("entity.donkey.name");

            case 2:
                return StatCollector.translateToLocal("entity.mule.name");

            case 3:
                return StatCollector.translateToLocal("entity.zombiehorse.name");

            case 4:
                return StatCollector.translateToLocal("entity.skeletonhorse.name");
        }
    }
}
项目:BaseClient    文件:ItemPotion.java   
public String getItemStackDisplayName(ItemStack stack)
{
    if (stack.getMetadata() == 0)
    {
        return StatCollector.translateToLocal("item.emptyPotion.name").trim();
    }
    else
    {
        String s = "";

        if (isSplash(stack.getMetadata()))
        {
            s = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " ";
        }

        List<PotionEffect> list = Items.potionitem.getEffects(stack);

        if (list != null && !list.isEmpty())
        {
            String s2 = ((PotionEffect)list.get(0)).getEffectName();
            s2 = s2 + ".postfix";
            return s + StatCollector.translateToLocal(s2).trim();
        }
        else
        {
            String s1 = PotionHelper.getPotionPrefix(stack.getMetadata());
            return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(stack);
        }
    }
}
项目:BaseClient    文件:ItemBanner.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = "item.banner.";
    EnumDyeColor enumdyecolor = this.getBaseColor(stack);
    s = s + enumdyecolor.getUnlocalizedName() + ".name";
    return StatCollector.translateToLocal(s);
}
项目:BaseClient    文件:ItemMonsterPlacer.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
    String s1 = EntityList.getStringFromID(stack.getMetadata());

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

    return s;
}
项目:BaseClient    文件:ItemBanner.java   
public String getItemStackDisplayName(ItemStack stack)
{
    String s = "item.banner.";
    EnumDyeColor enumdyecolor = this.getBaseColor(stack);
    s = s + enumdyecolor.getUnlocalizedName() + ".name";
    return StatCollector.translateToLocal(s);
}
项目:CursedLasso    文件:ItemCursedLasso.java   
public static String getDisplayNameForEntity(String mobName) {
    return StatCollector.translateToLocal("entity." + mobName + ".name");
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
/**
 * Gets the localized name of this block. Used for the statistics page.
 */
public String getLocalizedName()
{
    return StatCollector.translateToLocal("item.comparator.name");
}
项目:connor41-etfuturum2    文件:LingeringPotion.java   
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isComplex) {
    if (stack.getItemDamage() == 0)
        return;

    List<PotionEffect> effects = getEffects(stack);
    HashMultimap<String, AttributeModifier> attributes = HashMultimap.create();

    if (effects == null || effects.isEmpty()) {
        String s = StatCollector.translateToLocal("potion.empty").trim();
        list.add(EnumChatFormatting.GRAY + s);
    } else
        for (PotionEffect potioneffect : effects) {
            String s1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim();
            Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
            Map<IAttribute, AttributeModifier> map = potion.func_111186_k();

            if (map != null && map.size() > 0)
                for (Entry<IAttribute, AttributeModifier> entry : map.entrySet()) {
                    AttributeModifier attributemodifier = entry.getValue();
                    AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation());
                    attributes.put(entry.getKey().getAttributeUnlocalizedName(), attributemodifier1);
                }

            if (potioneffect.getAmplifier() > 0)
                s1 = s1 + " " + StatCollector.translateToLocal("potion.potency." + potioneffect.getAmplifier()).trim();
            if (potioneffect.getDuration() > 20)
                s1 = s1 + " (" + Potion.getDurationString(potioneffect) + ")";

            if (potion.isBadEffect())
                list.add(EnumChatFormatting.RED + s1);
            else
                list.add(EnumChatFormatting.GRAY + s1);
        }

    if (!attributes.isEmpty()) {
        list.add("");
        list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank"));

        for (Entry<String, AttributeModifier> entry1 : attributes.entries()) {
            AttributeModifier attributemodifier2 = entry1.getValue();
            double d0 = attributemodifier2.getAmount();
            double d1;

            if (attributemodifier2.getOperation() != 1 && attributemodifier2.getOperation() != 2)
                d1 = attributemodifier2.getAmount();
            else
                d1 = attributemodifier2.getAmount() * 100.0D;

            if (d0 > 0.0D)
                list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[] { ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + entry1.getKey()) }));
            else if (d0 < 0.0D) {
                d1 *= -1.0D;
                list.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[] { ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + entry1.getKey()) }));
            }
        }
    }
}
项目:nei-lotr    文件:BarrelRecipeHandler.java   
@Override
public String getRecipeName() {
    return StatCollector.translateToLocal("lotrNei.recipe.barrel.name") + " ("
            + StatCollector.translateToLocal("lotrNei.recipe.shapeless") + ")";
}
项目:nei-lotr    文件:HobbitOvenHandler.java   
@Override
public String getRecipeName() {
    return StatCollector.translateToLocal("container.lotr.hobbitOven");
}
项目:BaseClient    文件:BlockSapling.java   
/**
 * Gets the localized name of this block. Used for the statistics page.
 */
public String getLocalizedName()
{
    return StatCollector.translateToLocal(this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name");
}