Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. package lunadevs.luna.module.player;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4.  
  5. import com.darkmagician6.eventapi.EventTarget;
  6. import com.zCore.Core.zCore;
  7.  
  8. import lunadevs.luna.category.Category;
  9. import lunadevs.luna.events.EventPacket;
  10. import lunadevs.luna.events.PacketRecieveEvent;
  11. import lunadevs.luna.events.PacketSendEvent;
  12. import lunadevs.luna.module.Module;
  13. import net.minecraft.client.Minecraft;
  14. import net.minecraft.client.gui.GuiChat;
  15. import net.minecraft.client.settings.KeyBinding;
  16. import net.minecraft.network.play.client.C02PacketUseEntity;
  17. import net.minecraft.network.play.client.C0DPacketCloseWindow;
  18.  
  19. public class InventoryWalk extends Module{
  20.  
  21. public InventoryWalk() {
  22. super("InventoryWalk", Keyboard.KEY_B, Category.PLAYER, false);
  23. }
  24.  
  25. Integer[] keyBindingMove = { Integer.valueOf(mc.gameSettings.keyBindForward.getKeyCode()), Integer.valueOf(mc.gameSettings.keyBindBack.getKeyCode()), Integer.valueOf(mc.gameSettings.keyBindRight.getKeyCode()), Integer.valueOf(mc.gameSettings.keyBindLeft.getKeyCode()), Integer.valueOf(mc.gameSettings.keyBindJump.getKeyCode()) };
  26. Integer[] keyBindingLook = { Integer.valueOf(200), Integer.valueOf(208), Integer.valueOf(205), Integer.valueOf(203) };
  27.  
  28. @Override
  29. public void onUpdate() {
  30. if (!this.isEnabled) return;
  31. if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChat)){
  32. Integer[] arrayOfInteger;
  33. int j = (arrayOfInteger = this.keyBindingMove).length;
  34. for (int i = 0; i < j; i++)
  35. {
  36. Integer bindingMove = arrayOfInteger[i];KeyBinding.setKeyBindState(bindingMove.intValue(), Keyboard.isKeyDown(bindingMove.intValue()));
  37. }
  38. if (mc.currentScreen != null)
  39. {
  40. if (Keyboard.isKeyDown(this.keyBindingLook[0].intValue())) {
  41. mc.thePlayer.rotationPitch -= 5.0F;
  42. }
  43. if (Keyboard.isKeyDown(this.keyBindingLook[1].intValue())) {
  44. mc.thePlayer.rotationPitch += 5.0F;
  45. }
  46. if (Keyboard.isKeyDown(this.keyBindingLook[2].intValue())) {
  47. mc.thePlayer.rotationYaw += 5.0F;
  48. }
  49. if (Keyboard.isKeyDown(this.keyBindingLook[3].intValue())) {
  50. mc.thePlayer.rotationYaw -= 5.0F;
  51. }
  52. }
  53. }
  54. }
  55.  
  56.  
  57. @EventTarget
  58. public void onPacketRecieve(PacketRecieveEvent event)
  59. {
  60. if ((event.getPacket() instanceof C0DPacketCloseWindow)){
  61. event.setCancelled(true);
  62. }
  63. }
  64.  
  65.  
  66.  
  67. @Override
  68. public void onRender() {
  69.  
  70. }
  71.  
  72. @Override
  73. public void onEnable() {
  74.  
  75. }
  76.  
  77. @Override
  78. public void onDisable() {
  79.  
  80. }
  81.  
  82.  
  83. @Override
  84. public String getValue() {
  85. // TODO Auto-generated method stub
  86. return null;
  87. }
  88.  
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement