Advertisement
Guest User

Extended_Jamiga

a guest
Apr 12th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. package aJamigaPack1;
  2.  
  3. import net.minecraft.client.settings.KeyBinding;
  4.  
  5. import org.lwjgl.input.Keyboard;
  6.  
  7. import cpw.mods.fml.client.registry.KeyBindingRegistry;
  8.  
  9. public class RegisterKeyBindings
  10. {
  11. /** Key index for easy handling */
  12. public static final int CUSTOM_INV = 0;
  13.  
  14. /** Key descriptions */
  15. private static final String[] desc = {"Custom Inventory"};
  16.  
  17. /** Default key values */
  18. private static final int[] keyValues = {Keyboard.KEY_O};
  19.  
  20. /** This stores all of our key bindings and is always updated with the in-game settings */
  21. public static final KeyBinding[] keys = new KeyBinding[desc.length];
  22.  
  23. /** This initializes and registers all the key bindings */
  24. public static void init()
  25. {
  26. boolean[] repeat = new boolean[desc.length];
  27. // just use a for loop to run through all the values
  28. for (int i = 0; i < desc.length; ++i) {
  29. keys[i] = new KeyBinding(desc[i], keyValues[i]);
  30. repeat[i] = false;
  31. }
  32.  
  33. KeyBindingRegistry.registerKeyBinding(new TutKeyHandler(keys, repeat));
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement