當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyBinding.resetKeyBindingArrayAndHash方法代碼示例

本文整理匯總了Java中net.minecraft.client.settings.KeyBinding.resetKeyBindingArrayAndHash方法的典型用法代碼示例。如果您正苦於以下問題:Java KeyBinding.resetKeyBindingArrayAndHash方法的具體用法?Java KeyBinding.resetKeyBindingArrayAndHash怎麽用?Java KeyBinding.resetKeyBindingArrayAndHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.settings.KeyBinding的用法示例。


在下文中一共展示了KeyBinding.resetKeyBindingArrayAndHash方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: actionPerformed

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的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

示例2: mousePressed

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_)
{
    if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_))
    {
        GuiKeyBindingList.this.field_148191_k.buttonId = this.keybinding;
        return true;
    }
    else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_))
    {
        GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
        KeyBinding.resetKeyBindingArrayAndHash();
        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:GuiKeyBindingList.java

示例3: mousePressed

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
/**
 * Called when the mouse is clicked within this entry. Returning true means that something within this entry was
 * clicked and the list should not be dragged.
 */
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY)
{
    if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        GuiKeyBindingList.this.controlsScreen.buttonId = this.keybinding;
        return true;
    }
    else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        this.keybinding.setToDefault();
        GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
        KeyBinding.resetKeyBindingArrayAndHash();
        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:24,代碼來源:GuiKeyBindingList.java

示例4: mousePressed

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY)
{
    if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        GuiKeyBindingList.this.controlsScreen.buttonId = this.keybinding;
        return true;
    }
    else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
        KeyBinding.resetKeyBindingArrayAndHash();
        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:19,代碼來源:GuiKeyBindingList.java

示例5: actionPerformed

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的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.setToDefault();
        }

        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:F1r3w477,項目名稱:CustomWorldGen,代碼行數:25,代碼來源:GuiControls.java

示例6: keyTyped

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
@Override
public void keyTyped(char ch, int key) {
    if (changingKeybinding) {
        changingKeybinding = false;
        updateKeybindingButtonText();

        KeyHandler.getInstance().keybindOpenOptions.setKeyCode(key);
        KeyBinding.resetKeyBindingArrayAndHash();
        FMLClientHandler.instance().getClient().player.sendStatusMessage(new TextComponentString(TextFormatting.GREEN + "Bound the opening of this menu to the '" + Keyboard.getKeyName(key) + "' key."), false);
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:12,代碼來源:GuiHelmetMainOptions.java

示例7: bind

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
@Override
public void bind(int keyCode) {
    if(bind != null) {
        bind.setKeyCode(keyCode);
        KeyBinding.resetKeyBindingArrayAndHash();
    }
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:8,代碼來源:CommandStub.java

示例8: mouseClicked

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (this.buttonId != null)
    {
        this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton);
        this.buttonId = null;
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (mouseButton != 0 || !this.keyBindingList.mouseClicked(mouseX, mouseY, mouseButton))
    {
        super.mouseClicked(mouseX, mouseY, mouseButton);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:GuiControls.java

示例9: keyTyped

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (this.buttonId != null)
    {
        if (keyCode == 1)
        {
            this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, 0);
            this.options.setOptionKeyBinding(this.buttonId, 0);
        }
        else if (keyCode != 0)
        {
            this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), keyCode);
            this.options.setOptionKeyBinding(this.buttonId, keyCode);
        }
        else if (typedChar > 0)
        {
            this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), typedChar + 256);
            this.options.setOptionKeyBinding(this.buttonId, typedChar + 256);
        }

        if (!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(keyCode))
        this.buttonId = null;
        this.time = Minecraft.getSystemTime();
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else
    {
        super.keyTyped(typedChar, keyCode);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:35,代碼來源:GuiControls.java

示例10: keyTyped

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (this.buttonId != null)
    {
        if (keyCode == 1)
        {
            this.options.setOptionKeyBinding(this.buttonId, 0);
        }
        else if (keyCode != 0)
        {
            this.options.setOptionKeyBinding(this.buttonId, keyCode);
        }
        else if (typedChar > 0)
        {
            this.options.setOptionKeyBinding(this.buttonId, typedChar + 256);
        }

        this.buttonId = null;
        this.time = Minecraft.getSystemTime();
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else
    {
        super.keyTyped(typedChar, keyCode);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:31,代碼來源:GuiControls.java

示例11: mouseClicked

import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (this.buttonId != null)
    {
        this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), -100 + mouseButton);
        this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton);
        this.buttonId = null;
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (mouseButton != 0 || !this.keyBindingList.mouseClicked(mouseX, mouseY, mouseButton))
    {
        super.mouseClicked(mouseX, mouseY, mouseButton);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:GuiControls.java


注:本文中的net.minecraft.client.settings.KeyBinding.resetKeyBindingArrayAndHash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。