当前位置: 首页>>代码示例>>Java>>正文


Java GuiNewChat类代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiNewChat的典型用法代码示例。如果您正苦于以下问题:Java GuiNewChat类的具体用法?Java GuiNewChat怎么用?Java GuiNewChat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuiNewChat类属于net.minecraft.client.gui包,在下文中一共展示了GuiNewChat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearChat

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Command({"clear", "cc"})
public void clearChat() {
    GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
    List<ChatLine> tempList = new ArrayList<>();
    for (ChatLine c : (ArrayList<ChatLine>) mc.ingameGUI.persistantChatGUI.field_146253_i) {
        if (c.getChatComponent().getFormattedText().contains(Client.NAME)) {
            tempList.add(c);
        }
        for (Method m : getMap().keySet()) {
            Command command = m.getAnnotation(Command.class);
            if (c.getChatComponent().getFormattedText().contains(command.value()[0]) && (c.getChatComponent().getFormattedText().contains("]") || c.getChatComponent().getFormattedText().contains("]") || c.getChatComponent().getFormattedText().contains(","))) {
                tempList.add(c);
            }
        }

    }
    mc.ingameGUI.persistantChatGUI.field_146253_i.removeAll(tempList);
}
 
开发者ID:hvze,项目名称:Providence,代码行数:20,代码来源:CommandManager.java

示例2: sendNoSpamMessages

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
private static void sendNoSpamMessages(ITextComponent[] messages)
{
    GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
    for (int i = DELETION_ID + messages.length - 1; i <= lastAdded; i++)
    {
        chat.deleteChatLine(i);
    }
    for (int i = 0; i < messages.length; i++)
    {
        chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
    }
    lastAdded = DELETION_ID + messages.length - 1;
}
 
开发者ID:talandar,项目名称:ProgressiveDifficulty,代码行数:14,代码来源:ChatUtil.java

示例3: addChat

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
private static synchronized void addChat(final IChatComponent[] chat) {
    final GuiNewChat chatGUI = Minecraft.getMinecraft().ingameGUI.getChatGUI();
    for (int i = 0; i < chat.length; ++i) {
        final IChatComponent iChatComponent = chat[i];
        chatGUI.printChatMessageWithOptionalDeletion(iChatComponent, 983423323 + i);
    }
    for (int i = chat.length; i < PacketTempChatMultiline.lastNum; ++i) {
        chatGUI.deleteChatLine(983423323 + i);
    }
    PacketTempChatMultiline.lastNum = Math.max(PacketTempChatMultiline.lastNum, chat.length);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:12,代码来源:PacketTempChatMultiline.java

示例4: hookDrawStringWithShadow

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
@CoreInvoke
public static int hookDrawStringWithShadow(final @Nonnull FontRenderer font, final @Nonnull String str, final int x, final int y, final int color, final @Nonnull GuiNewChat chat, final @Nonnull ChatLine chatline, final int j2, final int opacity) {
	if (chatline instanceof PicChatLine) {
		final PicChatLine cline = (PicChatLine) chatline;
		OpenGL.glPushMatrix();
		OpenGL.glTranslatef(0f, j2, 0f);
		OpenGL.glColor4i(255, 255, 255, opacity);
		cline.draw(chat, font.FONT_HEIGHT);
		OpenGL.glPopMatrix();
		WRenderer.startTexture();
	} else
		// this.mc.fontRenderer.drawStringWithShadow(s, b0, j2-8, 16777215+(i2<<24));
		font.drawStringWithShadow(str, x, y, color);
	return 0;
}
 
开发者ID:Team-Fruit,项目名称:SignPicture,代码行数:16,代码来源:CustomChatRender.java

示例5: sendNoSpamMessages

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private static void sendNoSpamMessages(ITextComponent[] messages) {
	GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
	for (int i = DELETION_ID + messages.length - 1;i <= lastAdded;i++) {
		chat.deleteChatLine(i);
	}
	for (int i = 0;i < messages.length;i++) {
		chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
	}
	lastAdded = DELETION_ID + messages.length - 1;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:12,代码来源:TomsModUtils.java

示例6: dumpError

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
private synchronized void dumpError(String tag) {
    state = new State(TextFormatting.RED
            + I18n.format("enchantmentrevealer.error.mainmessage"), NO_STRINGS, NO_INTS,
            observations.get(observations.size() - 1));
    GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
    chat.printChatMessage(new TextComponentTranslation("enchantmentrevealer.error.part1",
            new TextComponentTranslation("enchantmentrevealer.error." + tag), "d0sboots",
            "gmai", "l.com").setStyle(new Style().setColor(TextFormatting.RED)
            .setBold(true)));
    chat.printChatMessage(new TextComponentTranslation("enchantmentrevealer.error.part2")
            .setStyle(new Style().setColor(TextFormatting.YELLOW)));
    for (Observation observation : observations) {
        chat.printChatMessage(new TextComponentString(observation.toString())
                .setStyle(new Style().setColor(TextFormatting.YELLOW)));
    }
    observations.clear();
    candidatesLength = 0;
    thread = null;
    shrink();
}
 
开发者ID:d0sboots,项目名称:EnchantmentRevealer,代码行数:21,代码来源:EnchantmentWorker.java

示例7: sendNoSpamMessages

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
private static void sendNoSpamMessages(IChatComponent[] messages) {
  GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
  for (int i = DELETION_ID + messages.length - 1; i <= lastAdded; i++) {
    chat.deleteChatLine(i);
  }
  for (int i = 0; i < messages.length; i++) {
    chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
  }
  lastAdded = DELETION_ID + messages.length - 1;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:11,代码来源:ChatUtil.java

示例8: displayChatMessages

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
private static void displayChatMessages(ITextComponent[] messages) {
    GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
    for (int i = DELETION_ID + messages.length - 1; i <= lastAdded; i++) {
        chat.deleteChatLine(i);
    }

    for (int i = 0; i < messages.length; i++) {
        chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
    }

    lastAdded = DELETION_ID + messages.length - 1;
}
 
开发者ID:joshiejack,项目名称:Progression,代码行数:13,代码来源:ChatHelper.java

示例9: print

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
public static void print(String msg, TextFormatting format, Object... args) {
    if (MC.ingameGUI == null) {
        return;
    }

    GuiNewChat chat = MC.ingameGUI.getChatGUI();
    TextComponentTranslation ret = new TextComponentTranslation(msg, args);
    ret.getStyle().setColor(format);

    chat.printChatMessage(ret);
}
 
开发者ID:ata4,项目名称:minema,代码行数:12,代码来源:ChatUtils.java

示例10: sendNoSpamMessages

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
private static void sendNoSpamMessages(ITextComponent[] messages)
{
	GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
	for (int i = DELETION_ID + messages.length - 1; i <= lastAdded; i++)
	{
		chat.deleteChatLine(i);
	}
	for (int i = 0; i < messages.length; i++)
	{
		chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
	}
	lastAdded = DELETION_ID + messages.length - 1;
}
 
开发者ID:Xilef11,项目名称:Runes-of-Wizardry,代码行数:14,代码来源:ChatUtils.java

示例11: func_74297_c

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
public String func_74297_c(EnumOptions p_74297_1_) {
   String var2 = I18n.func_135053_a(p_74297_1_.func_74378_d()) + ": ";
   if(p_74297_1_.func_74380_a()) {
      float var5 = this.func_74296_a(p_74297_1_);
      return p_74297_1_ == EnumOptions.SENSITIVITY?(var5 == 0.0F?var2 + I18n.func_135053_a("options.sensitivity.min"):(var5 == 1.0F?var2 + I18n.func_135053_a("options.sensitivity.max"):var2 + (int)(var5 * 200.0F) + "%")):(p_74297_1_ == EnumOptions.FOV?(var5 == 0.0F?var2 + I18n.func_135053_a("options.fov.min"):(var5 == 1.0F?var2 + I18n.func_135053_a("options.fov.max"):var2 + (int)(70.0F + var5 * 40.0F))):(p_74297_1_ == EnumOptions.GAMMA?(var5 == 0.0F?var2 + I18n.func_135053_a("options.gamma.min"):(var5 == 1.0F?var2 + I18n.func_135053_a("options.gamma.max"):var2 + "+" + (int)(var5 * 100.0F) + "%")):(p_74297_1_ == EnumOptions.CHAT_OPACITY?var2 + (int)(var5 * 90.0F + 10.0F) + "%":(p_74297_1_ == EnumOptions.CHAT_HEIGHT_UNFOCUSED?var2 + GuiNewChat.func_96130_b(var5) + "px":(p_74297_1_ == EnumOptions.CHAT_HEIGHT_FOCUSED?var2 + GuiNewChat.func_96130_b(var5) + "px":(p_74297_1_ == EnumOptions.CHAT_WIDTH?var2 + GuiNewChat.func_96128_a(var5) + "px":(var5 == 0.0F?var2 + I18n.func_135053_a("options.off"):var2 + (int)(var5 * 100.0F) + "%")))))));
   } else if(p_74297_1_.func_74382_b()) {
      boolean var4 = this.func_74308_b(p_74297_1_);
      return var4?var2 + I18n.func_135053_a("options.on"):var2 + I18n.func_135053_a("options.off");
   } else if(p_74297_1_ == EnumOptions.RENDER_DISTANCE) {
      return var2 + func_74299_a(field_74360_ac, this.field_74339_e);
   } else if(p_74297_1_ == EnumOptions.DIFFICULTY) {
      return var2 + func_74299_a(field_74361_ad, this.field_74318_M);
   } else if(p_74297_1_ == EnumOptions.GUI_SCALE) {
      return var2 + func_74299_a(field_74367_ae, this.field_74335_Z);
   } else if(p_74297_1_ == EnumOptions.CHAT_VISIBILITY) {
      return var2 + func_74299_a(field_74369_af, this.field_74343_n);
   } else if(p_74297_1_ == EnumOptions.PARTICLES) {
      return var2 + func_74299_a(field_74364_ag, this.field_74362_aa);
   } else if(p_74297_1_ == EnumOptions.FRAMERATE_LIMIT) {
      return var2 + func_74299_a(field_74365_ah, this.field_74350_i);
   } else if(p_74297_1_ == EnumOptions.AMBIENT_OCCLUSION) {
      return var2 + func_74299_a(field_98303_au, this.field_74348_k);
   } else if(p_74297_1_ == EnumOptions.GRAPHICS) {
      if(this.field_74347_j) {
         return var2 + I18n.func_135053_a("options.graphics.fancy");
      } else {
         String var3 = "options.graphics.fast";
         return var2 + I18n.func_135053_a("options.graphics.fast");
      }
   } else {
      return var2;
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:34,代码来源:GameSettings.java

示例12: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options p_74297_1_)
{
    String s = I18n.format(p_74297_1_.getEnumString(), new Object[0]) + ": ";

    if (p_74297_1_.getEnumFloat())
    {
        float f1 = this.getOptionFloatValue(p_74297_1_);
        float f = p_74297_1_.normalizeValue(f1);
        return p_74297_1_ == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int)(f * 200.0F) + "%")) : (p_74297_1_ == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int)f1)) : (p_74297_1_ == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == p_74297_1_.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int)f1 + " fps") : (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS ? (f1 == p_74297_1_.valueMin ? s + I18n.format("options.cloudHeight.min", new Object[0]) : s + ((int)f1 + 128)) : (p_74297_1_ == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int)(f * 100.0F) + "%")) : (p_74297_1_ == GameSettings.Options.SATURATION ? s + (int)(f * 400.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_OPACITY ? s + (int)(f * 90.0F + 10.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.calculateChatboxWidth(f) + "px" : (p_74297_1_ == GameSettings.Options.RENDER_DISTANCE ? s + (int)f1 + " chunks" : (p_74297_1_ == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)f1) : (p_74297_1_ == GameSettings.Options.STREAM_FPS ? s + TwitchStream.formatStreamFps(f) + " fps" : (p_74297_1_ == GameSettings.Options.STREAM_KBPS ? s + TwitchStream.formatStreamKbps(f) + " Kbps" : (p_74297_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? s + String.format("%.3f bpp", new Object[] {Float.valueOf(TwitchStream.formatStreamBps(f))}): (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)(f * 100.0F) + "%")))))))))))))));
    }
    else if (p_74297_1_.getEnumBoolean())
    {
        boolean flag = this.getOptionOrdinalValue(p_74297_1_);
        return flag ? s + I18n.format("options.on", new Object[0]) : s + I18n.format("options.off", new Object[0]);
    }
    else if (p_74297_1_ == GameSettings.Options.GUI_SCALE)
    {
        return s + getTranslation(GUISCALES, this.guiScale);
    }
    else if (p_74297_1_ == GameSettings.Options.CHAT_VISIBILITY)
    {
        return s + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
    }
    else if (p_74297_1_ == GameSettings.Options.PARTICLES)
    {
        return s + getTranslation(PARTICLES, this.particleSetting);
    }
    else if (p_74297_1_ == GameSettings.Options.AMBIENT_OCCLUSION)
    {
        return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_COMPRESSION)
    {
        return s + getTranslation(STREAM_COMPRESSIONS, this.streamCompression);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_ENABLED)
    {
        return s + getTranslation(STREAM_CHAT_MODES, this.streamChatEnabled);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_USER_FILTER)
    {
        return s + getTranslation(STREAM_CHAT_FILTER_MODES, this.streamChatUserFilter);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR)
    {
        return s + getTranslation(STREAM_MIC_MODES, this.streamMicToggleBehavior);
    }
    else if (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS)
    {
        return s + getTranslation(field_181149_aW, this.clouds);
    }
    else if (p_74297_1_ == GameSettings.Options.GRAPHICS)
    {
        if (this.fancyGraphics)
        {
            return s + I18n.format("options.graphics.fancy", new Object[0]);
        }
        else
        {
            String s1 = "options.graphics.fast";
            return s + I18n.format("options.graphics.fast", new Object[0]);
        }
    }
    else
    {
        return s;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:72,代码来源:GameSettings.java

示例13: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options p_74297_1_)
{
    String s = this.getKeyBindingOF(p_74297_1_);

    if (s != null)
    {
        return s;
    }
    else
    {
        String s1 = I18n.format(p_74297_1_.getEnumString(), new Object[0]) + ": ";

        if (p_74297_1_.getEnumFloat())
        {
            float f1 = this.getOptionFloatValue(p_74297_1_);
            float f = p_74297_1_.normalizeValue(f1);
            return p_74297_1_ == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s1 + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.sensitivity.max", new Object[0]) : s1 + (int)(f * 200.0F) + "%")) : (p_74297_1_ == GameSettings.Options.FOV ? (f1 == 70.0F ? s1 + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s1 + I18n.format("options.fov.max", new Object[0]) : s1 + (int)f1)) : (p_74297_1_ == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == p_74297_1_.valueMax ? s1 + I18n.format("options.framerateLimit.max", new Object[0]) : s1 + (int)f1 + " fps") : (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS ? (f1 == p_74297_1_.valueMin ? s1 + I18n.format("options.cloudHeight.min", new Object[0]) : s1 + ((int)f1 + 128)) : (p_74297_1_ == GameSettings.Options.GAMMA ? (f == 0.0F ? s1 + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.gamma.max", new Object[0]) : s1 + "+" + (int)(f * 100.0F) + "%")) : (p_74297_1_ == GameSettings.Options.SATURATION ? s1 + (int)(f * 400.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_OPACITY ? s1 + (int)(f * 90.0F + 10.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_WIDTH ? s1 + GuiNewChat.calculateChatboxWidth(f) + "px" : (p_74297_1_ == GameSettings.Options.RENDER_DISTANCE ? s1 + (int)f1 + " chunks" : (p_74297_1_ == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)f1) : (p_74297_1_ == GameSettings.Options.STREAM_FPS ? s1 + TwitchStream.formatStreamFps(f) + " fps" : (p_74297_1_ == GameSettings.Options.STREAM_KBPS ? s1 + TwitchStream.formatStreamKbps(f) + " Kbps" : (p_74297_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? s1 + String.format("%.3f bpp", new Object[] {Float.valueOf(TwitchStream.formatStreamBps(f))}): (f == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)(f * 100.0F) + "%")))))))))))))));
        }
        else if (p_74297_1_.getEnumBoolean())
        {
            boolean flag = this.getOptionOrdinalValue(p_74297_1_);
            return flag ? s1 + I18n.format("options.on", new Object[0]) : s1 + I18n.format("options.off", new Object[0]);
        }
        else if (p_74297_1_ == GameSettings.Options.GUI_SCALE)
        {
            return s1 + getTranslation(GUISCALES, this.guiScale);
        }
        else if (p_74297_1_ == GameSettings.Options.CHAT_VISIBILITY)
        {
            return s1 + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
        }
        else if (p_74297_1_ == GameSettings.Options.PARTICLES)
        {
            return s1 + getTranslation(PARTICLES, this.particleSetting);
        }
        else if (p_74297_1_ == GameSettings.Options.AMBIENT_OCCLUSION)
        {
            return s1 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_COMPRESSION)
        {
            return s1 + getTranslation(STREAM_COMPRESSIONS, this.streamCompression);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_ENABLED)
        {
            return s1 + getTranslation(STREAM_CHAT_MODES, this.streamChatEnabled);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_USER_FILTER)
        {
            return s1 + getTranslation(STREAM_CHAT_FILTER_MODES, this.streamChatUserFilter);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR)
        {
            return s1 + getTranslation(STREAM_MIC_MODES, this.streamMicToggleBehavior);
        }
        else if (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS)
        {
            return s1 + getTranslation(field_181149_aW, this.clouds);
        }
        else if (p_74297_1_ == GameSettings.Options.GRAPHICS)
        {
            if (this.fancyGraphics)
            {
                return s1 + I18n.format("options.graphics.fancy", new Object[0]);
            }
            else
            {
                String s2 = "options.graphics.fast";
                return s1 + I18n.format("options.graphics.fast", new Object[0]);
            }
        }
        else
        {
            return s1;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:81,代码来源:GameSettings.java

示例14: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options settingOption)
{
    String s = this.getKeyBindingOF(settingOption);

    if (s != null)
    {
        return s;
    }
    else
    {
        String s1 = I18n.format(settingOption.getEnumString(), new Object[0]) + ": ";

        if (settingOption.getEnumFloat())
        {
            float f1 = this.getOptionFloatValue(settingOption);
            float f = settingOption.normalizeValue(f1);
            return settingOption == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s1 + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.sensitivity.max", new Object[0]) : s1 + (int)(f * 200.0F) + "%")) : (settingOption == GameSettings.Options.FOV ? (f1 == 70.0F ? s1 + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s1 + I18n.format("options.fov.max", new Object[0]) : s1 + (int)f1)) : (settingOption == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == settingOption.valueMax ? s1 + I18n.format("options.framerateLimit.max", new Object[0]) : s1 + I18n.format("options.framerate", new Object[] {Integer.valueOf((int)f1)})): (settingOption == GameSettings.Options.RENDER_CLOUDS ? (f1 == settingOption.valueMin ? s1 + I18n.format("options.cloudHeight.min", new Object[0]) : s1 + ((int)f1 + 128)) : (settingOption == GameSettings.Options.GAMMA ? (f == 0.0F ? s1 + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.gamma.max", new Object[0]) : s1 + "+" + (int)(f * 100.0F) + "%")) : (settingOption == GameSettings.Options.SATURATION ? s1 + (int)(f * 400.0F) + "%" : (settingOption == GameSettings.Options.CHAT_OPACITY ? s1 + (int)(f * 90.0F + 10.0F) + "%" : (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_WIDTH ? s1 + GuiNewChat.calculateChatboxWidth(f) + "px" : (settingOption == GameSettings.Options.RENDER_DISTANCE ? s1 + I18n.format("options.chunks", new Object[] {Integer.valueOf((int)f1)}): (settingOption == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)f1) : (f == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)(f * 100.0F) + "%"))))))))))));
        }
        else if (settingOption.getEnumBoolean())
        {
            boolean flag = this.getOptionOrdinalValue(settingOption);
            return flag ? s1 + I18n.format("options.on", new Object[0]) : s1 + I18n.format("options.off", new Object[0]);
        }
        else if (settingOption == GameSettings.Options.MAIN_HAND)
        {
            return s1 + this.mainHand;
        }
        else if (settingOption == GameSettings.Options.GUI_SCALE)
        {
            return this.guiScale >= GUISCALES.length ? s1 + this.guiScale + "x" : s1 + getTranslation(GUISCALES, this.guiScale);
        }
        else if (settingOption == GameSettings.Options.CHAT_VISIBILITY)
        {
            return s1 + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
        }
        else if (settingOption == GameSettings.Options.PARTICLES)
        {
            return s1 + getTranslation(PARTICLES, this.particleSetting);
        }
        else if (settingOption == GameSettings.Options.AMBIENT_OCCLUSION)
        {
            return s1 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
        }
        else if (settingOption == GameSettings.Options.RENDER_CLOUDS)
        {
            return s1 + getTranslation(CLOUDS_TYPES, this.clouds);
        }
        else if (settingOption == GameSettings.Options.GRAPHICS)
        {
            if (this.fancyGraphics)
            {
                return s1 + I18n.format("options.graphics.fancy", new Object[0]);
            }
            else
            {
                String s2 = "options.graphics.fast";
                return s1 + I18n.format("options.graphics.fast", new Object[0]);
            }
        }
        else
        {
            return settingOption == GameSettings.Options.ATTACK_INDICATOR ? s1 + getTranslation(ATTACK_INDICATORS, this.attackIndicator) : s1;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:69,代码来源:GameSettings.java

示例15: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options settingOption)
{
    String s = I18n.format(settingOption.getEnumString(), new Object[0]) + ": ";

    if (settingOption.getEnumFloat())
    {
        float f1 = this.getOptionFloatValue(settingOption);
        float f = settingOption.normalizeValue(f1);
        return settingOption == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int)(f * 200.0F) + "%")) : (settingOption == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int)f1)) : (settingOption == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == settingOption.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int)f1 + " fps") : (settingOption == GameSettings.Options.RENDER_CLOUDS ? (f1 == settingOption.valueMin ? s + I18n.format("options.cloudHeight.min", new Object[0]) : s + ((int)f1 + 128)) : (settingOption == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int)(f * 100.0F) + "%")) : (settingOption == GameSettings.Options.SATURATION ? s + (int)(f * 400.0F) + "%" : (settingOption == GameSettings.Options.CHAT_OPACITY ? s + (int)(f * 90.0F + 10.0F) + "%" : (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.calculateChatboxWidth(f) + "px" : (settingOption == GameSettings.Options.RENDER_DISTANCE ? s + (int)f1 + " chunks" : (settingOption == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)f1) : (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)(f * 100.0F) + "%"))))))))))));
    }
    else if (settingOption.getEnumBoolean())
    {
        boolean flag = this.getOptionOrdinalValue(settingOption);
        return flag ? s + I18n.format("options.on", new Object[0]) : s + I18n.format("options.off", new Object[0]);
    }
    else if (settingOption == GameSettings.Options.MAIN_HAND)
    {
        return s + this.mainHand;
    }
    else if (settingOption == GameSettings.Options.GUI_SCALE)
    {
        return s + getTranslation(GUISCALES, this.guiScale);
    }
    else if (settingOption == GameSettings.Options.CHAT_VISIBILITY)
    {
        return s + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
    }
    else if (settingOption == GameSettings.Options.PARTICLES)
    {
        return s + getTranslation(PARTICLES, this.particleSetting);
    }
    else if (settingOption == GameSettings.Options.AMBIENT_OCCLUSION)
    {
        return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
    }
    else if (settingOption == GameSettings.Options.RENDER_CLOUDS)
    {
        return s + getTranslation(CLOUDS_TYPES, this.clouds);
    }
    else if (settingOption == GameSettings.Options.GRAPHICS)
    {
        if (this.fancyGraphics)
        {
            return s + I18n.format("options.graphics.fancy", new Object[0]);
        }
        else
        {
            String s1 = "options.graphics.fast";
            return s + I18n.format("options.graphics.fast", new Object[0]);
        }
    }
    else
    {
        return settingOption == GameSettings.Options.ATTACK_INDICATOR ? s + getTranslation(ATTACK_INDICATORS, this.attackIndicator) : s;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:60,代码来源:GameSettings.java


注:本文中的net.minecraft.client.gui.GuiNewChat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。