mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 21:20:06 +00:00
Merge pull request #2 from groovyben008/patch-1
Updated src/api/java/modwarriors/notenoughkeys
This commit is contained in:
commit
6910bd3eae
3 files changed
+13
-6
No files matched your search
@@ -25,13 +25,14 @@ public class Api {
|
||||
* Registers a mod's keys with NEK
|
||||
*
|
||||
* @param modname The NAME of the mod registering the key
|
||||
* @param keyDecriptions A String[] (Array[String]) of the key descriptions. i.e. new String[]{"key.hotbar1"}
|
||||
* @param keyDescriptions A String[] (Array[String]) of the key descriptions
|
||||
* as an inherit array. i.e. ("modName", "key.hotbar1", "key.hotbar2")
|
||||
*/
|
||||
public static void registerMod(String modname, String[] keyDecriptions) {
|
||||
public static void registerMod(String modname, String... keyDescriptions) {
|
||||
try {
|
||||
Class.forName("modwarriors.notenoughkeys.keys.KeyHelper").getMethod(
|
||||
"registerMod", String.class, String[].class
|
||||
).invoke(null, modname, keyDecriptions);
|
||||
).invoke(null, modname, keyDescriptions);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,12 @@ public class KeyBindingPressedEvent extends Event {
|
||||
* Tells whether a modifier was required AND was down when triggered
|
||||
*/
|
||||
public boolean shiftRequired = false, ctrlRequired = false, altRequired = false;
|
||||
/**
|
||||
* Use this variable to check if your key is pressed. DO NOT check KeyBinding.getIsKeyPressed().
|
||||
* That value will return only if the main key is pressed or not.
|
||||
* @see modwarriors.notenoughkeys.keys.KeyEvents refreshBindings
|
||||
*/
|
||||
public boolean isKeyBindingPressed;
|
||||
|
||||
/**
|
||||
* Called with the passed keyBinding and modifiers.
|
||||
@@ -31,13 +37,13 @@ public class KeyBindingPressedEvent extends Event {
|
||||
* @param keyBinding The KeyBinding being triggered. Stores the key's description and keycode
|
||||
* @param modifiers The modifiers (SHIFT, CTRL, ALT) that determine when a compatible key is pressed
|
||||
*/
|
||||
public KeyBindingPressedEvent(KeyBinding keyBinding, boolean[] modifiers) {
|
||||
public KeyBindingPressedEvent(KeyBinding keyBinding, boolean[] modifiers, boolean isPressed) {
|
||||
super();
|
||||
this.keyBinding = keyBinding;
|
||||
this.shiftRequired = modifiers[0];
|
||||
this.ctrlRequired = modifiers[1];
|
||||
this.altRequired = modifiers[2];
|
||||
|
||||
this.isKeyBindingPressed = isPressed;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
@API(owner = "Not Enough Keys", provides = "API_NEK",
|
||||
apiVersion = "1.0.0") package modwarriors.notenoughkeys.api;
|
||||
apiVersion = "1.1.0") package modwarriors.notenoughkeys.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
Reference in new issue
Block a user