    001    package net.minecraft.client;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import net.minecraft.client.settings.GameSettings;
    006    import net.minecraft.stats.IStatStringFormat;
    007
    008    @SideOnly(Side.CLIENT)
    009    public class StatStringFormatKeyInv implements IStatStringFormat
    010    {
    011        /** Minecraft instance */
    012        final Minecraft mc;
    013
    014        public StatStringFormatKeyInv(Minecraft par1Minecraft)
    015        {
    016            this.mc = par1Minecraft;
    017        }
    018
    019        /**
    020         * Formats the strings based on 'IStatStringFormat' interface.
    021         */
    022        public String formatString(String par1Str)
    023        {
    024            try
    025            {
    026                return String.format(par1Str, new Object[] {GameSettings.getKeyDisplayString(this.mc.gameSettings.keyBindInventory.keyCode)});
    027            }
    028            catch (Exception var3)
    029            {
    030                return "Error: " + var3.getLocalizedMessage();
    031            }
    032        }
    033    }