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


Java GameSettings类代码示例

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


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

示例1: init

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
public void init(FMLInitializationEvent event)
{
       // Register for various events:
       FMLCommonHandler.instance().bus().register(this);
       MinecraftForge.EVENT_BUS.register(this);

       GameSettings settings = Minecraft.getMinecraft().gameSettings;
       setUpExtraKeys(settings);

       this.stateMachine = new ClientStateMachine(ClientState.WAITING_FOR_MOD_READY, this);
       
       this.originalMouseHelper = Minecraft.getMinecraft().mouseHelper;
       this.mouseHook = new MouseHook();
       this.mouseHook.isOverriding = true;
       Minecraft.getMinecraft().mouseHelper = this.mouseHook;
       setInputType(InputType.AI);
   }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:18,代码来源:MalmoModClient.java

示例2: actionPerformed

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id < 100 && button instanceof GuiOptionButton)
        {
            this.game_settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.game_settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.parentScreen);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:ScreenChatOptions.java

示例3: initGui

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = 0;
    this.title = I18n.format("options.skinCustomisation.title", new Object[0]);

    for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values())
    {
        this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, enumplayermodelparts));
        ++i;
    }

    this.buttonList.add(new GuiOptionButton(199, this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), GameSettings.Options.MAIN_HAND, this.mc.gameSettings.getKeyBinding(GameSettings.Options.MAIN_HAND)));
    ++i;

    if (i % 2 == 1)
    {
        ++i;
    }

    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done", new Object[0])));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:GuiCustomizeSkin.java

示例4: SoundManager

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_)
{
    this.invPlayingSounds = ((BiMap)this.playingSounds).inverse();
    this.categorySounds = HashMultimap.<SoundCategory, String>create();
    this.tickableSounds = Lists.<ITickableSound>newArrayList();
    this.delayedSounds = Maps.<ISound, Integer>newHashMap();
    this.playingSoundsStopTime = Maps.<String, Integer>newHashMap();
    this.listeners = Lists.<ISoundEventListener>newArrayList();
    this.pausedChannels = Lists.<String>newArrayList();
    this.sndHandler = p_i45119_1_;
    this.options = p_i45119_2_;

    try
    {
        SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
        SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
    }
    catch (SoundSystemException soundsystemexception)
    {
        LOGGER.error(LOG_MARKER, (String)"Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:SoundManager.java

示例5: initGui

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = 0;
    this.field_146401_i = I18n.format("options.chat.title", new Object[0]);

    for (GameSettings.Options gamesettings$options : field_146399_a)
    {
        if (gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options));
        }
        else
        {
            this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options, this.game_settings.getKeyBinding(gamesettings$options)));
        }

        ++i;
    }

    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 120, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:ScreenChatOptions.java

示例6: initGui

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.title = I18n.format("options.sounds.title", new Object[0]);
    this.offDisplayString = I18n.format("options.off", new Object[0]);
    int i = 0;
    this.buttonList.add(new GuiScreenOptionsSounds.Button(SoundCategory.MASTER.ordinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), SoundCategory.MASTER, true));
    i = i + 2;

    for (SoundCategory soundcategory : SoundCategory.values())
    {
        if (soundcategory != SoundCategory.MASTER)
        {
            this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.ordinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), soundcategory, false));
            ++i;
        }
    }

    int j = this.width / 2 - 75;
    int k = this.height / 6 - 12;
    ++i;
    this.buttonList.add(new GuiOptionButton(201, j, k + 24 * (i >> 1), GameSettings.Options.SHOW_SUBTITLES, this.game_settings_4.getKeyBinding(GameSettings.Options.SHOW_SUBTITLES)));
    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:GuiScreenOptionsSounds.java

示例7: actionPerformed

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 200)
    {
        this.mc.displayGuiScreen(this.parentScreen);
    }
    else if (button.id == 201)
    {
        for (KeyBinding keybinding : this.mc.gameSettings.keyBindings)
        {
            keybinding.setKeyCode(keybinding.getKeyCodeDefault());
        }

        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (button.id < 100 && button instanceof GuiOptionButton)
    {
        this.options.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
        button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:GuiControls.java

示例8: drawScreen

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    this.drawDefaultBackground();
    int i = (this.width - 248) / 2 + 10;
    int j = (this.height - 166) / 2 + 8;
    this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583);
    j = j + 12;
    GameSettings gamesettings = this.mc.gameSettings;
    this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}), i, j, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}), i, j + 24, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}), i, j + 36, 5197647);
    this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583);
    super.drawScreen(mouseX, mouseY, partialTicks);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:GuiScreenDemo.java

示例9: actionPerformed

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id == 2)
        {
            this.game_settings_2.saveOptions();
            this.game_settings_2.saveOptions();
            this.mc.displayGuiScreen(this.lastScreen);
        }

        if (button.id == 1)
        {
            this.game_settings_2.setOptionValue(GameSettings.Options.SNOOPER_ENABLED, 1);
            this.toggleButton.displayString = this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:GuiSnooper.java

示例10: renderSlot

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
private void renderSlot(int p_175266_1_, int p_175266_2_, float p_175266_3_, float p_175266_4_, ISpectatorMenuObject p_175266_5_)
{
    this.mc.getTextureManager().bindTexture(SPECTATOR_WIDGETS);

    if (p_175266_5_ != SpectatorMenu.EMPTY_SLOT)
    {
        int i = (int)(p_175266_4_ * 255.0F);
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)p_175266_2_, p_175266_3_, 0.0F);
        float f = p_175266_5_.isEnabled() ? 1.0F : 0.25F;
        GlStateManager.color(f, f, f, p_175266_4_);
        p_175266_5_.renderIcon(f, i);
        GlStateManager.popMatrix();
        String s = String.valueOf((Object)GameSettings.getKeyDisplayString(this.mc.gameSettings.keyBindsHotbar[p_175266_1_].getKeyCode()));

        if (i > 3 && p_175266_5_.isEnabled())
        {
            this.mc.fontRendererObj.drawStringWithShadow(s, (float)(p_175266_2_ + 19 - 2 - this.mc.fontRendererObj.getStringWidth(s)), p_175266_3_ + 6.0F + 3.0F, 16777215 + (i << 24));
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:GuiSpectator.java

示例11: drawScreen

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Draws the screen and all the components in it.
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    this.drawDefaultBackground();
    int i = (this.width - 248) / 2 + 10;
    int j = (this.height - 166) / 2 + 8;
    this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583);
    j = j + 12;
    GameSettings gamesettings = this.mc.gameSettings;
    this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {gamesettings.keyBindForward.getDisplayName(), gamesettings.keyBindLeft.getDisplayName(), gamesettings.keyBindBack.getDisplayName(), gamesettings.keyBindRight.getDisplayName()}), i, j, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {gamesettings.keyBindJump.getDisplayName()}), i, j + 24, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {gamesettings.keyBindInventory.getDisplayName()}), i, j + 36, 5197647);
    this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583);
    super.drawScreen(mouseX, mouseY, partialTicks);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:GuiScreenDemo.java

示例12: actionPerformed

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id != GameSettings.Options.AA_LEVEL.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight());
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:27,代码来源:GuiQualitySettingsOF.java

示例13: drawScreen

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Draws the screen and all the components in it.
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    this.drawDefaultBackground();
    int i = (this.width - 248) / 2 + 10;
    int j = (this.height - 166) / 2 + 8;
    this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583);
    j = j + 12;
    GameSettings gamesettings = this.mc.gameSettings;
    this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}), i, j, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}), i, j + 24, 5197647);
    this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}), i, j + 36, 5197647);
    this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583);
    super.drawScreen(mouseX, mouseY, partialTicks);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:GuiScreenDemo.java

示例14: initGui

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.title = I18n.format("of.options.animationsTitle", new Object[0]);
    this.buttonList.clear();

    for (int i = 0; i < enumOptions.length; ++i)
    {
        GameSettings.Options gamesettings$options = enumOptions[i];
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 12;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }
    }

    this.buttonList.add(new GuiButton(210, this.width / 2 - 155, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOn")));
    this.buttonList.add(new GuiButton(211, this.width / 2 - 155 + 80, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOff")));
    this.buttonList.add(new GuiOptionButton(200, this.width / 2 + 5, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:GuiAnimationSettingsOF.java

示例15: actionPerformed

import net.minecraft.client.settings.GameSettings; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.parent);
        }
        else if (button.id == 201)
        {
            this.mc.gameSettings.setOptionValue(GameSettings.Options.SHOW_SUBTITLES, 1);
            button.displayString = this.mc.gameSettings.getKeyBinding(GameSettings.Options.SHOW_SUBTITLES);
            this.mc.gameSettings.saveOptions();
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:GuiScreenOptionsSounds.java


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