Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 12.67 KB | None | 0 0
  1. package com.direxartworks.venom.module.modules;
  2.  
  3. import com.direxartworks.venom.Venom;
  4. import com.direxartworks.venom.command.Command;
  5. import com.direxartworks.venom.event.EventTarget;
  6. import com.direxartworks.venom.event.IEvent.State;
  7. import com.direxartworks.venom.event.events.MoveEvent;
  8. import com.direxartworks.venom.event.events.UpdateEvent;
  9. import com.direxartworks.venom.module.Category;
  10. import com.direxartworks.venom.module.Module;
  11. import com.direxartworks.venom.module.ModuleManager;
  12. import com.direxartworks.venom.module.ModuleManifest;
  13. import com.direxartworks.venom.module.options.ValueString;
  14. import com.direxartworks.venom.utilities.ChatUtil;
  15. import com.direxartworks.venom.utilities.MathUtils;
  16. import com.direxartworks.venom.utilities.TimeHelper;
  17. import java.util.List;
  18. import net.minecraft.client.Minecraft;
  19. import net.minecraft.client.entity.EntityPlayerSP;
  20. import net.minecraft.client.multiplayer.WorldClient;
  21. import net.minecraft.potion.Potion;
  22. import net.minecraft.potion.PotionEffect;
  23. import net.minecraft.util.AxisAlignedBB;
  24. import net.minecraft.util.MovementInput;
  25.  
  26. @ModuleManifest(cat=Category.MOVEMENT, name="BunnyHop")
  27. public class BunnyHop
  28.   extends Module
  29. {
  30.   private int cooldown;
  31.  
  32.   public BunnyHop()
  33.   {
  34.     addToValues("mode", this.mode);
  35.   }
  36.  
  37.   public ValueString mode = new ValueString("hive");
  38.   private int state;
  39.   private double lastDist;
  40.   private boolean slowbecausewater;
  41.   private double movementSpeed;
  42.  
  43.   @EventTarget
  44.   public void on(UpdateEvent e)
  45.   {
  46.     String str;
  47.     switch ((str = (String)this.mode.value).hashCode())
  48.     {
  49.     case -1240298764:
  50.       if (str.equals("gomme1")) {
  51.         break;
  52.       }
  53.       break;
  54.     case -1240298763:
  55.       if (str.equals("gomme2")) {}
  56.       break;
  57.     case 107348:
  58.       if (str.equals("low")) {}
  59.       break;
  60.     case 3202928:
  61.       if (str.equals("hive")) {}
  62.       break;
  63.     case 3327612:
  64.       if (!str.equals("long"))
  65.       {
  66.         return;setDisplayName("�dBunnyHop �5GommeHD1");
  67.         return;
  68.        
  69.         setDisplayName("�dBunnyHop �5GommeHD2");
  70.         return;
  71.        
  72.         setDisplayName("�dBunnyHop �5HiveMC");
  73.         return;
  74.        
  75.         setDisplayName("�dBunnyHop �5LOW");
  76.       }
  77.       else
  78.       {
  79.         setDisplayName("�dBunnyHop �5LONG");
  80.       }
  81.       break;
  82.     }
  83.   }
  84.  
  85.   private double getBaseMovement()
  86.   {
  87.     double base = 0.0D;
  88.     String str;
  89.     switch ((str = (String)this.mode.value).hashCode())
  90.     {
  91.     case -1240298764:
  92.       if (str.equals("gomme1")) {
  93.         break;
  94.       }
  95.       break;
  96.     case -1240298763:
  97.       if (str.equals("gomme2")) {}
  98.       break;
  99.     case 107348:
  100.       if (str.equals("low")) {}
  101.       break;
  102.     case 3202928:
  103.       if (str.equals("hive")) {}
  104.       break;
  105.     case 3327612:
  106.       if (!str.equals("long"))
  107.       {
  108.         break label163;
  109.         base = 0.15D;
  110.         break label163;
  111.         base = 0.15D;
  112.         break label163;
  113.         base = 0.2873D;
  114.         break label163;
  115.         base = 0.16D;
  116.       }
  117.       else
  118.       {
  119.         base = 0.518D;
  120.       }
  121.       break;
  122.     }
  123.     label163:
  124.     if (Minecraft.thePlayer.isPotionActive(Potion.moveSpeed))
  125.     {
  126.       int remain = Minecraft.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier();
  127.       base *= (1.0D + 0.2D * (remain + 1));
  128.     }
  129.     return base;
  130.   }
  131.  
  132.   @EventTarget
  133.   public void onPre(UpdateEvent e)
  134.   {
  135.     if (e.getState() == State.PRE)
  136.     {
  137.       if ((Minecraft.thePlayer.moveForward == 0.0F) && (Minecraft.thePlayer.moveStrafing == 0.0F) && (Minecraft.thePlayer.onGround))
  138.       {
  139.         this.cooldown = 2;
  140.         this.state = 2;
  141.       }
  142.       double xDist = Minecraft.thePlayer.posX - Minecraft.thePlayer.prevPosX;
  143.       double zDist = Minecraft.thePlayer.posZ - Minecraft.thePlayer.prevPosZ;
  144.       this.lastDist = Math.sqrt(xDist * xDist + zDist * zDist);
  145.     }
  146.   }
  147.  
  148.   TimeHelper timer = new TimeHelper();
  149.   public int reset = 0;
  150.  
  151.   @EventTarget
  152.   public void on(MoveEvent e)
  153.   {
  154.     if ((Minecraft.thePlayer.isInsideBlock()) || (Minecraft.thePlayer.isOnLadder()) || (Minecraft.thePlayer.isEntityInsideOpaqueBlock()))
  155.     {
  156.       this.movementSpeed = 0.0D;
  157.       this.slowbecausewater = true;
  158.       return;
  159.     }
  160.     if (this.slowbecausewater)
  161.     {
  162.       this.movementSpeed = 0.0D;
  163.       this.slowbecausewater = false;
  164.       return;
  165.     }
  166.     if ((Minecraft.thePlayer.moveForward == 0.0F) && (Minecraft.thePlayer.moveStrafing == 0.0F)) {
  167.       return;
  168.     }
  169.     if (Minecraft.thePlayer.onGround)
  170.     {
  171.       this.state = 2;
  172.       this.mc.timer.timerSpeed = 1.0F;
  173.     }
  174.     if (MathUtils.round(Minecraft.thePlayer.posY - (int)Minecraft.thePlayer.posY, 3) == MathUtils.round(0.138D, 3))
  175.     {
  176.       Minecraft.thePlayer.motionY -= 0.08D;
  177.       e.y -= 0.09316090325960147D;
  178.       Minecraft.thePlayer.posY -= 0.09316090325960147D;
  179.     }
  180.     if ((this.state == 1) && ((Minecraft.thePlayer.moveForward != 0.0F) || (Minecraft.thePlayer.moveStrafing != 0.0F)))
  181.     {
  182.       this.state = 2;
  183.       this.movementSpeed = (1.35D * getBaseMovement() - 0.01D);
  184.     }
  185.     else if (this.state == 2)
  186.     {
  187.       this.state = 3;
  188.       if ((Minecraft.thePlayer.moveForward != 0.0F) || (Minecraft.thePlayer.moveStrafing != 0.0F))
  189.       {
  190.         String str;
  191.         switch ((str = (String)this.mode.value).hashCode())
  192.         {
  193.         case -1240298764:
  194.           if (str.equals("gomme1")) {
  195.             break;
  196.           }
  197.           break;
  198.         case -1240298763:
  199.           if (str.equals("gomme2")) {}
  200.           break;
  201.         case 107348:
  202.           if (str.equals("low")) {}
  203.           break;
  204.         case 3202928:
  205.           if (str.equals("hive")) {}
  206.           break;
  207.         case 3327612:
  208.           if (!str.equals("long"))
  209.           {
  210.             break label831;
  211.             Minecraft.thePlayer.motionY = 0.41999998688697815D;
  212.             e.y = 0.41999998688697815D;
  213.             if (this.cooldown > 0) {
  214.               this.cooldown -= 1;
  215.             }
  216.             this.movementSpeed *= 2.15563D;
  217.            
  218.             this.timer.setLastMS();
  219.             break label831;
  220.             Minecraft.thePlayer.motionY = 0.41999998688697815D;
  221.             e.y = 0.41999998688697815D;
  222.             if (this.cooldown > 0) {
  223.               this.cooldown -= 1;
  224.             }
  225.             this.movementSpeed *= 2.14D;
  226.             break label831;
  227.             Minecraft.thePlayer.motionY = 0.4D;
  228.             e.y = 0.4D;
  229.             if (this.cooldown > 0) {
  230.               this.cooldown -= 1;
  231.             }
  232.             this.movementSpeed *= 2.149D;
  233.             break label831;
  234.             if (this.reset <= 3)
  235.             {
  236.               this.reset += 1;
  237.             }
  238.             else
  239.             {
  240.               Minecraft.thePlayer.motionY = 0.04D;
  241.               e.y = 0.04D;
  242.               if (this.cooldown > 0) {
  243.                 this.cooldown -= 1;
  244.               }
  245.               this.movementSpeed *= 1.907D;
  246.               this.reset = 1;
  247.             }
  248.           }
  249.           else
  250.           {
  251.             Minecraft.thePlayer.motionY = 0.34468D;
  252.             e.y = 0.34468D;
  253.             if (this.cooldown > 0) {
  254.               this.cooldown -= 1;
  255.             }
  256.             this.movementSpeed *= 1.8549D;
  257.           }
  258.           break;
  259.         }
  260.       }
  261.     }
  262.     else if (this.state == 3)
  263.     {
  264.       this.state = 4;
  265.       double difference = 0.66667D * (this.lastDist - getBaseMovement());
  266.       this.movementSpeed = (this.lastDist - difference);
  267.       if ((String)this.mode.value == "gomme1")
  268.       {
  269.         if (this.timer.isDelayComplete(230L))
  270.         {
  271.           e.y = -0.0132D;
  272.           Minecraft.thePlayer.motionY = -0.0132D;
  273.         }
  274.       }
  275.       else {
  276.         ((String)this.mode.value);
  277.       }
  278.     }
  279.     else
  280.     {
  281.       if ((this.mc.theWorld.getCollidingBoundingBoxes(Minecraft.thePlayer, Minecraft.thePlayer.boundingBox.offset(0.0D, Minecraft.thePlayer.motionY, 0.0D)).size() > 0) || (Minecraft.thePlayer.isCollidedVertically)) {
  282.         this.state = 1;
  283.       }
  284.       this.movementSpeed = (this.lastDist - this.lastDist / 159.0D);
  285.     }
  286.     label831:
  287.     this.movementSpeed = Math.max(this.movementSpeed, getBaseMovement());
  288.     MovementInput movementInput = Minecraft.thePlayer.movementInput;
  289.     float forward = movementInput.moveForward;
  290.     float strafe = movementInput.moveStrafe;
  291.     float yaw = Minecraft.thePlayer.rotationYaw;
  292.     if ((forward == 0.0F) && (strafe == 0.0F))
  293.     {
  294.       e.x = 0.0D;
  295.       e.z = 0.0D;
  296.     }
  297.     else if (forward != 0.0F)
  298.     {
  299.       if (strafe >= 1.0F)
  300.       {
  301.         yaw += (forward > 0.0F ? -45 : 45);
  302.         strafe = 0.0F;
  303.       }
  304.       else if (strafe <= -1.0F)
  305.       {
  306.         yaw += (forward > 0.0F ? 45 : -45);
  307.         strafe = 0.0F;
  308.       }
  309.       if (forward > 0.0F) {
  310.         forward = 1.0F;
  311.       } else if (forward < 0.0F) {
  312.         forward = -1.0F;
  313.       }
  314.     }
  315.     double mx = Math.cos(Math.toRadians(yaw + 90.0F));
  316.     double mz = Math.sin(Math.toRadians(yaw + 90.0F));
  317.     double motionX = forward * this.movementSpeed * mx + strafe * this.movementSpeed * mz;
  318.     double motionZ = forward * this.movementSpeed * mz - strafe * this.movementSpeed * mx;
  319.     if (this.cooldown == 0)
  320.     {
  321.       if (((Minecraft.thePlayer.isUsingItem()) || (Minecraft.thePlayer.isBlocking())) && (!Venom.getInstance().getModuleManager().getModule(NoSlowdown.class).isEnabled()))
  322.       {
  323.         motionX *= 0.4000000059604645D;
  324.         motionZ *= 0.4000000059604645D;
  325.       }
  326.       e.x = (forward * this.movementSpeed * mx + strafe * this.movementSpeed * mz);
  327.       e.z = (forward * this.movementSpeed * mz - strafe * this.movementSpeed * mx);
  328.     }
  329.     Minecraft.thePlayer.stepHeight = 0.6F;
  330.     if ((forward == 0.0F) && (strafe == 0.0F))
  331.     {
  332.       e.x = 0.0D;
  333.       e.z = 0.0D;
  334.     }
  335.     else
  336.     {
  337.       boolean collideCheck = false;
  338.       if (this.mc.theWorld.getCollidingBoundingBoxes(Minecraft.thePlayer, Minecraft.thePlayer.boundingBox.expand(0.1D, 0.1D, 0.1D)).size() > 0) {
  339.         collideCheck = true;
  340.       }
  341.       if (forward != 0.0F)
  342.       {
  343.         if (strafe >= 1.0F)
  344.         {
  345.           yaw += (forward > 0.0F ? -45 : 45);
  346.           strafe = 0.0F;
  347.         }
  348.         else if (strafe <= -1.0F)
  349.         {
  350.           yaw += (forward > 0.0F ? 45 : -45);
  351.           strafe = 0.0F;
  352.         }
  353.         if (forward > 0.0F) {
  354.           forward = 1.0F;
  355.         } else if (forward < 0.0F) {
  356.           forward = -1.0F;
  357.         }
  358.       }
  359.     }
  360.   }
  361.  
  362.   public static class BHOPCMD
  363.     extends Command
  364.   {
  365.     public BHOPCMD()
  366.     {
  367.       super();
  368.     }
  369.    
  370.     public void onCommand()
  371.     {
  372.       if (getArguments().length == 3)
  373.       {
  374.         if (getArguments()[1].equals("mode"))
  375.         {
  376.           if (getArguments()[2].equalsIgnoreCase("gomme1"))
  377.           {
  378.             Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "gomme1";
  379.             ChatUtil.sendChatMessage("Mode set to �eGommeHD1");
  380.           }
  381.           else if (getArguments()[2].equals("hive"))
  382.           {
  383.             Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "hive";
  384.             ChatUtil.sendChatMessage("Mode set to �eHiveMC");
  385.           }
  386.           else if (getArguments()[2].equals("gomme2"))
  387.           {
  388.             Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "gomme2";
  389.             ChatUtil.sendChatMessage("Mode set to �eGommeHD2");
  390.           }
  391.           else if (getArguments()[2].equals("low"))
  392.           {
  393.             Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "low";
  394.             ChatUtil.sendChatMessage("Mode set to �eLOW");
  395.           }
  396.           else if (getArguments()[2].equals("long"))
  397.           {
  398.             Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "long";
  399.             ChatUtil.sendChatMessage("Mode set to �eLONG");
  400.           }
  401.           else
  402.           {
  403.             ChatUtil.sendChatMessage("�c.bhop help");
  404.           }
  405.         }
  406.         else {
  407.           ChatUtil.sendChatMessage("�c.bhop help");
  408.         }
  409.       }
  410.       else if (getArguments().length == 2)
  411.       {
  412.         if (getArguments()[1].equalsIgnoreCase("help"))
  413.         {
  414.           ChatUtil.sendChatMessage("�c.bhop mode <gomme(1/2)/hive/low/long>");
  415.           ChatUtil.sendChatMessage("�eSets the bhop mode.");
  416.         }
  417.         else
  418.         {
  419.           ChatUtil.sendChatMessage("�c.bhop help");
  420.         }
  421.       }
  422.       else {
  423.         ChatUtil.sendChatMessage("�c.bhop help");
  424.       }
  425.       super.onCommand();
  426.     }
  427.   }
  428. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement