本文整理汇总了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);
}
}