Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. package RevampClient.command.commands;
  2.  
  3. import java.io.IOException;
  4.  
  5. import org.lwjgl.input.Keyboard;
  6.  
  7. import RevampClient.Revamp;
  8. import RevampClient.Module.Module;
  9. import RevampClient.command.Command;
  10.  
  11. public class Bind extends Command {
  12.  
  13. @Override
  14. public String getAlias() {
  15. return "bind";
  16. }
  17.  
  18. @Override
  19. public String getDiscription() {
  20. return "Ändert den Keybind von einem Module.";
  21. }
  22.  
  23. @Override
  24. public String getSyntax() {
  25. return ".bind <Module> <KeyBind>";
  26. }
  27.  
  28. @Override
  29. public void onCommand(String command, String[] args) throws IOException {
  30.  
  31. if(args[0].equalsIgnoreCase("set")) {
  32. args[2] = args[2].toUpperCase();
  33. int key = Keyboard.getKeyIndex(args[2]);
  34.  
  35. for(Module m : Revamp.getModules()) {
  36. if(args[1].equalsIgnoreCase(m.name)) {
  37. m.setKeybind(Keyboard.getKeyIndex(Keyboard.getKeyName(key)));
  38. Revamp.addChatMessage("Der Keybind von dem Module "+args[1] +" wurde geändert");
  39.  
  40. }
  41.  
  42. }
  43. }
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement