summaryrefslogtreecommitdiff
path: root/src/api/java/modwarriors/notenoughkeys
diff options
context:
space:
mode:
authorLance5057 <Lance5057@gmail.com>2016-08-06 21:47:17 -0500
committerLance5057 <Lance5057@gmail.com>2016-08-06 21:47:17 -0500
commitd10fd21692bad49e75a7d665005df940c91942f8 (patch)
treefdc1be156df395c88a934f6f97487e78b36a8138 /src/api/java/modwarriors/notenoughkeys
parentff41fd97eb377dd1ebd78b4b56e81c59ca786667 (diff)
Launch update
Only a week behind...
Diffstat (limited to 'src/api/java/modwarriors/notenoughkeys')
-rw-r--r--src/api/java/modwarriors/notenoughkeys/api/Api.java20
-rw-r--r--src/api/java/modwarriors/notenoughkeys/api/KeyBindingPressedEvent.java19
-rw-r--r--src/api/java/modwarriors/notenoughkeys/api/package-info.java6
3 files changed, 26 insertions, 19 deletions
diff --git a/src/api/java/modwarriors/notenoughkeys/api/Api.java b/src/api/java/modwarriors/notenoughkeys/api/Api.java
index 390d28a..5da1ae8 100644
--- a/src/api/java/modwarriors/notenoughkeys/api/Api.java
+++ b/src/api/java/modwarriors/notenoughkeys/api/Api.java
@@ -10,14 +10,16 @@ import cpw.mods.fml.relauncher.SideOnly;
* @author TheTemportalist
*/
@SideOnly(Side.CLIENT)
-public class Api {
+public class Api
+{
/**
* Checks if NotEnoughKeys is loaded in the current environment
*
* @return 'true' if loaded
*/
- public static boolean isLoaded() {
+ public static boolean isLoaded()
+ {
return Loader.isModLoaded("notenoughkeys");
}
@@ -27,12 +29,14 @@ public class Api {
* @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"}
*/
- public static void registerMod(String modname, String[] keyDecriptions) {
- try {
- Class.forName("modwarriors.notenoughkeys.keys.KeyHelper").getMethod(
- "registerMod", String.class, String[].class
- ).invoke(null, modname, keyDecriptions);
- } catch (Exception e) {
+ public static void registerMod(String modname, String[] keyDecriptions)
+ {
+ try
+ {
+ Class.forName("modwarriors.notenoughkeys.keys.KeyHelper").getMethod("registerMod", String.class, String[].class).invoke(null, modname, keyDecriptions);
+ }
+ catch(final Exception e)
+ {
e.printStackTrace();
}
}
diff --git a/src/api/java/modwarriors/notenoughkeys/api/KeyBindingPressedEvent.java b/src/api/java/modwarriors/notenoughkeys/api/KeyBindingPressedEvent.java
index d17b808..850ec6a 100644
--- a/src/api/java/modwarriors/notenoughkeys/api/KeyBindingPressedEvent.java
+++ b/src/api/java/modwarriors/notenoughkeys/api/KeyBindingPressedEvent.java
@@ -1,10 +1,10 @@
package modwarriors.notenoughkeys.api;
+import net.minecraft.client.settings.KeyBinding;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.client.settings.KeyBinding;
/**
* Called when a keybinding is triggered with the passed with valid modifiers
@@ -13,16 +13,18 @@ import net.minecraft.client.settings.KeyBinding;
*/
@SideOnly(Side.CLIENT)
@Cancelable
-public class KeyBindingPressedEvent extends Event {
+public class KeyBindingPressedEvent extends Event
+{
/**
* The KeyBinding being triggered
*/
- public KeyBinding keyBinding = null;
+ public KeyBinding keyBinding = null;
/**
* Tells whether a modifier was required AND was down when triggered
*/
- public boolean shiftRequired = false, ctrlRequired = false, altRequired = false;
+ public boolean shiftRequired = false, ctrlRequired = false,
+ altRequired = false;
/**
* Called with the passed keyBinding and modifiers.
@@ -31,12 +33,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)
+ {
super();
this.keyBinding = keyBinding;
- this.shiftRequired = modifiers[0];
- this.ctrlRequired = modifiers[1];
- this.altRequired = modifiers[2];
+ shiftRequired = modifiers[0];
+ ctrlRequired = modifiers[1];
+ altRequired = modifiers[2];
}
diff --git a/src/api/java/modwarriors/notenoughkeys/api/package-info.java b/src/api/java/modwarriors/notenoughkeys/api/package-info.java
index d53b000..913ae44 100644
--- a/src/api/java/modwarriors/notenoughkeys/api/package-info.java
+++ b/src/api/java/modwarriors/notenoughkeys/api/package-info.java
@@ -1,5 +1,5 @@
-
-@API(owner = "Not Enough Keys", provides = "API_NEK",
- apiVersion = "1.0.0") package modwarriors.notenoughkeys.api;
+@API(owner = "Not Enough Keys", provides = "API_NEK", apiVersion = "1.0.0")
+package modwarriors.notenoughkeys.api;
import cpw.mods.fml.common.API;
+