本文整理匯總了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));
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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));
}
}
示例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);
}
}
示例7: bind
import net.minecraft.client.settings.KeyBinding; //導入方法依賴的package包/類
@Override
public void bind(int keyCode) {
if(bind != null) {
bind.setKeyCode(keyCode);
KeyBinding.resetKeyBindingArrayAndHash();
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}