Portl

Untitled

Oct 22nd, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. public class Juan extends AuraMode
  2. {
  3. private boolean setupTick;
  4. private EntityLivingBase target;
  5.  
  6. public Juan(final String name, final boolean value, final Module module) {
  7. super(name, value, module);
  8. }
  9.  
  10. @Override
  11. public boolean enable() {
  12. if (super.enable()) {
  13. this.target = null;
  14. }
  15. return true;
  16. }
  17.  
  18. @Override
  19. public boolean onUpdate(final UpdateEvent event) {
  20. if (super.onUpdate(event)) {
  21. switch (event.getState()) {
  22. case PRE: {
  23. StateManager.setOffsetLastPacketAura(false);
  24. final Aura auraModule = (Aura)this.getModule();
  25. final NoSlowdown noSlowdownModule = (NoSlowdown)new NoSlowdown().getInstance();
  26. if (this.target == null || !auraModule.isEntityValid(this.target)) {
  27. this.target = (this.getTargets().isEmpty() ? null : this.getTargets().get(0));
  28. }
  29. if (this.target != null) {
  30. if (auraModule.autoblock && ClientUtils.player().getCurrentEquippedItem() != null && ClientUtils.player().getCurrentEquippedItem().getItem() instanceof ItemSword) {
  31. ClientUtils.playerController().sendUseItem(ClientUtils.player(), ClientUtils.world(), ClientUtils.player().getCurrentEquippedItem());
  32. if (!noSlowdownModule.isEnabled() && auraModule.noslowdown) {
  33. ClientUtils.packet(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
  34. }
  35. }
  36. final float[] rotations = RotationUtils.getRotations(this.target);
  37. event.setYaw(rotations[0]);
  38. event.setPitch(rotations[1]);
  39. if (this.setupTick) {
  40. if (auraModule.criticals && ClientUtils.player().isCollidedVertically && this.bhopCheck()) {
  41. event.setY(event.getY() + 0.07);
  42. event.setGround(false);
  43. }
  44. }
  45. else {
  46. if (auraModule.criticals && ClientUtils.player().isCollidedVertically && this.bhopCheck()) {
  47. event.setGround(false);
  48. event.setAlwaysSend(true);
  49. }
  50. if (ClientUtils.player().fallDistance > 0.0f && ClientUtils.player().fallDistance < 0.66) {
  51. event.setGround(true);
  52. }
  53. }
  54. }
  55. this.setupTick = !this.setupTick;
  56. break;
  57. }
  58. case POST: {
  59. final Aura auraModule = (Aura)this.getModule();
  60. if (this.target == null) {
  61. break;
  62. }
  63. if (ClientUtils.player().isBlocking()) {
  64. ClientUtils.packet(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
  65. }
  66. auraModule.attack(this.target);
  67. if (ClientUtils.player().isBlocking()) {
  68. ClientUtils.packet(new C08PacketPlayerBlockPlacement(ClientUtils.player().inventory.getCurrentItem()));
  69. break;
  70. }
  71. break;
  72. }
  73. }
  74. }
  75. return true;
  76. }
  77.  
  78. private boolean bhopCheck() {
  79. if (new Speed().getInstance().isEnabled() && ((Speed)new Speed().getInstance()).bhop.getValue()) {
  80. if (ClientUtils.player().moveForward != 0.0f || ClientUtils.player().moveStrafing != 0.0f) {
  81. return false;
  82. }
  83. Bhop.stage = -4;
  84. }
  85. return true;
  86. }
  87.  
  88. private List<EntityLivingBase> getTargets() {
  89. final List<EntityLivingBase> targets = new ArrayList<EntityLivingBase>();
  90. for (final Entity entity : ClientUtils.loadedEntityList()) {
  91. if (((Aura)this.getModule()).isEntityValid(entity)) {
  92. targets.add((EntityLivingBase)entity);
  93. }
  94. }
  95. targets.sort(new Comparator<EntityLivingBase>() {
  96. @Override
  97. public int compare(final EntityLivingBase target1, final EntityLivingBase target2) {
  98. return Math.round(target2.getHealth() - target1.getHealth());
  99. }
  100. });
  101. return targets;
  102. }
  103. }
Add Comment
Please, Sign In to add comment