summaryrefslogtreecommitdiff
path: root/java/darkknight/jewelrycraft/events/KeyBindings.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/darkknight/jewelrycraft/events/KeyBindings.java')
-rw-r--r--java/darkknight/jewelrycraft/events/KeyBindings.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/java/darkknight/jewelrycraft/events/KeyBindings.java b/java/darkknight/jewelrycraft/events/KeyBindings.java
new file mode 100644
index 0000000..462be0c
--- /dev/null
+++ b/java/darkknight/jewelrycraft/events/KeyBindings.java
@@ -0,0 +1,32 @@
+package darkknight.jewelrycraft.events;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.settings.KeyBinding;
+
+import org.lwjgl.input.Keyboard;
+
+import cpw.mods.fml.client.registry.ClientRegistry;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.InputEvent;
+import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+
+public class KeyBindings
+{
+ public static KeyBinding render = new KeyBinding("Pretty Render", Keyboard.KEY_Z, "Jewelrycraft");
+ public static KeyBinding inventory = new KeyBinding("Jewelry Inventory", Keyboard.KEY_J, "Jewelrycraft");
+
+ public KeyBindings()
+ {
+ ClientRegistry.registerKeyBinding(render);
+ ClientRegistry.registerKeyBinding(inventory);
+ }
+
+ @SubscribeEvent
+ public void onKeyInput(InputEvent.KeyInputEvent event)
+ {
+ if (render.isPressed()) JewelrycraftMod.fancyRender = !JewelrycraftMod.fancyRender;
+ if (inventory.isPressed()) JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
+ }
+} \ No newline at end of file