Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.direxartworks.venom.module.modules;
- import com.direxartworks.venom.Venom;
- import com.direxartworks.venom.command.Command;
- import com.direxartworks.venom.event.EventTarget;
- import com.direxartworks.venom.event.IEvent.State;
- import com.direxartworks.venom.event.events.MoveEvent;
- import com.direxartworks.venom.event.events.UpdateEvent;
- import com.direxartworks.venom.module.Category;
- import com.direxartworks.venom.module.Module;
- import com.direxartworks.venom.module.ModuleManager;
- import com.direxartworks.venom.module.ModuleManifest;
- import com.direxartworks.venom.module.options.ValueString;
- import com.direxartworks.venom.utilities.ChatUtil;
- import com.direxartworks.venom.utilities.MathUtils;
- import com.direxartworks.venom.utilities.TimeHelper;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.entity.EntityPlayerSP;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.potion.Potion;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.util.AxisAlignedBB;
- import net.minecraft.util.MovementInput;
- @ModuleManifest(cat=Category.MOVEMENT, name="BunnyHop")
- public class BunnyHop
- extends Module
- {
- private int cooldown;
- public BunnyHop()
- {
- addToValues("mode", this.mode);
- }
- public ValueString mode = new ValueString("hive");
- private int state;
- private double lastDist;
- private boolean slowbecausewater;
- private double movementSpeed;
- @EventTarget
- public void on(UpdateEvent e)
- {
- String str;
- switch ((str = (String)this.mode.value).hashCode())
- {
- case -1240298764:
- if (str.equals("gomme1")) {
- break;
- }
- break;
- case -1240298763:
- if (str.equals("gomme2")) {}
- break;
- case 107348:
- if (str.equals("low")) {}
- break;
- case 3202928:
- if (str.equals("hive")) {}
- break;
- case 3327612:
- if (!str.equals("long"))
- {
- return;setDisplayName("�dBunnyHop �5GommeHD1");
- return;
- setDisplayName("�dBunnyHop �5GommeHD2");
- return;
- setDisplayName("�dBunnyHop �5HiveMC");
- return;
- setDisplayName("�dBunnyHop �5LOW");
- }
- else
- {
- setDisplayName("�dBunnyHop �5LONG");
- }
- break;
- }
- }
- private double getBaseMovement()
- {
- double base = 0.0D;
- String str;
- switch ((str = (String)this.mode.value).hashCode())
- {
- case -1240298764:
- if (str.equals("gomme1")) {
- break;
- }
- break;
- case -1240298763:
- if (str.equals("gomme2")) {}
- break;
- case 107348:
- if (str.equals("low")) {}
- break;
- case 3202928:
- if (str.equals("hive")) {}
- break;
- case 3327612:
- if (!str.equals("long"))
- {
- break label163;
- base = 0.15D;
- break label163;
- base = 0.15D;
- break label163;
- base = 0.2873D;
- break label163;
- base = 0.16D;
- }
- else
- {
- base = 0.518D;
- }
- break;
- }
- label163:
- if (Minecraft.thePlayer.isPotionActive(Potion.moveSpeed))
- {
- int remain = Minecraft.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier();
- base *= (1.0D + 0.2D * (remain + 1));
- }
- return base;
- }
- @EventTarget
- public void onPre(UpdateEvent e)
- {
- if (e.getState() == State.PRE)
- {
- if ((Minecraft.thePlayer.moveForward == 0.0F) && (Minecraft.thePlayer.moveStrafing == 0.0F) && (Minecraft.thePlayer.onGround))
- {
- this.cooldown = 2;
- this.state = 2;
- }
- double xDist = Minecraft.thePlayer.posX - Minecraft.thePlayer.prevPosX;
- double zDist = Minecraft.thePlayer.posZ - Minecraft.thePlayer.prevPosZ;
- this.lastDist = Math.sqrt(xDist * xDist + zDist * zDist);
- }
- }
- TimeHelper timer = new TimeHelper();
- public int reset = 0;
- @EventTarget
- public void on(MoveEvent e)
- {
- if ((Minecraft.thePlayer.isInsideBlock()) || (Minecraft.thePlayer.isOnLadder()) || (Minecraft.thePlayer.isEntityInsideOpaqueBlock()))
- {
- this.movementSpeed = 0.0D;
- this.slowbecausewater = true;
- return;
- }
- if (this.slowbecausewater)
- {
- this.movementSpeed = 0.0D;
- this.slowbecausewater = false;
- return;
- }
- if ((Minecraft.thePlayer.moveForward == 0.0F) && (Minecraft.thePlayer.moveStrafing == 0.0F)) {
- return;
- }
- if (Minecraft.thePlayer.onGround)
- {
- this.state = 2;
- this.mc.timer.timerSpeed = 1.0F;
- }
- if (MathUtils.round(Minecraft.thePlayer.posY - (int)Minecraft.thePlayer.posY, 3) == MathUtils.round(0.138D, 3))
- {
- Minecraft.thePlayer.motionY -= 0.08D;
- e.y -= 0.09316090325960147D;
- Minecraft.thePlayer.posY -= 0.09316090325960147D;
- }
- if ((this.state == 1) && ((Minecraft.thePlayer.moveForward != 0.0F) || (Minecraft.thePlayer.moveStrafing != 0.0F)))
- {
- this.state = 2;
- this.movementSpeed = (1.35D * getBaseMovement() - 0.01D);
- }
- else if (this.state == 2)
- {
- this.state = 3;
- if ((Minecraft.thePlayer.moveForward != 0.0F) || (Minecraft.thePlayer.moveStrafing != 0.0F))
- {
- String str;
- switch ((str = (String)this.mode.value).hashCode())
- {
- case -1240298764:
- if (str.equals("gomme1")) {
- break;
- }
- break;
- case -1240298763:
- if (str.equals("gomme2")) {}
- break;
- case 107348:
- if (str.equals("low")) {}
- break;
- case 3202928:
- if (str.equals("hive")) {}
- break;
- case 3327612:
- if (!str.equals("long"))
- {
- break label831;
- Minecraft.thePlayer.motionY = 0.41999998688697815D;
- e.y = 0.41999998688697815D;
- if (this.cooldown > 0) {
- this.cooldown -= 1;
- }
- this.movementSpeed *= 2.15563D;
- this.timer.setLastMS();
- break label831;
- Minecraft.thePlayer.motionY = 0.41999998688697815D;
- e.y = 0.41999998688697815D;
- if (this.cooldown > 0) {
- this.cooldown -= 1;
- }
- this.movementSpeed *= 2.14D;
- break label831;
- Minecraft.thePlayer.motionY = 0.4D;
- e.y = 0.4D;
- if (this.cooldown > 0) {
- this.cooldown -= 1;
- }
- this.movementSpeed *= 2.149D;
- break label831;
- if (this.reset <= 3)
- {
- this.reset += 1;
- }
- else
- {
- Minecraft.thePlayer.motionY = 0.04D;
- e.y = 0.04D;
- if (this.cooldown > 0) {
- this.cooldown -= 1;
- }
- this.movementSpeed *= 1.907D;
- this.reset = 1;
- }
- }
- else
- {
- Minecraft.thePlayer.motionY = 0.34468D;
- e.y = 0.34468D;
- if (this.cooldown > 0) {
- this.cooldown -= 1;
- }
- this.movementSpeed *= 1.8549D;
- }
- break;
- }
- }
- }
- else if (this.state == 3)
- {
- this.state = 4;
- double difference = 0.66667D * (this.lastDist - getBaseMovement());
- this.movementSpeed = (this.lastDist - difference);
- if ((String)this.mode.value == "gomme1")
- {
- if (this.timer.isDelayComplete(230L))
- {
- e.y = -0.0132D;
- Minecraft.thePlayer.motionY = -0.0132D;
- }
- }
- else {
- ((String)this.mode.value);
- }
- }
- else
- {
- if ((this.mc.theWorld.getCollidingBoundingBoxes(Minecraft.thePlayer, Minecraft.thePlayer.boundingBox.offset(0.0D, Minecraft.thePlayer.motionY, 0.0D)).size() > 0) || (Minecraft.thePlayer.isCollidedVertically)) {
- this.state = 1;
- }
- this.movementSpeed = (this.lastDist - this.lastDist / 159.0D);
- }
- label831:
- this.movementSpeed = Math.max(this.movementSpeed, getBaseMovement());
- MovementInput movementInput = Minecraft.thePlayer.movementInput;
- float forward = movementInput.moveForward;
- float strafe = movementInput.moveStrafe;
- float yaw = Minecraft.thePlayer.rotationYaw;
- if ((forward == 0.0F) && (strafe == 0.0F))
- {
- e.x = 0.0D;
- e.z = 0.0D;
- }
- else if (forward != 0.0F)
- {
- if (strafe >= 1.0F)
- {
- yaw += (forward > 0.0F ? -45 : 45);
- strafe = 0.0F;
- }
- else if (strafe <= -1.0F)
- {
- yaw += (forward > 0.0F ? 45 : -45);
- strafe = 0.0F;
- }
- if (forward > 0.0F) {
- forward = 1.0F;
- } else if (forward < 0.0F) {
- forward = -1.0F;
- }
- }
- double mx = Math.cos(Math.toRadians(yaw + 90.0F));
- double mz = Math.sin(Math.toRadians(yaw + 90.0F));
- double motionX = forward * this.movementSpeed * mx + strafe * this.movementSpeed * mz;
- double motionZ = forward * this.movementSpeed * mz - strafe * this.movementSpeed * mx;
- if (this.cooldown == 0)
- {
- if (((Minecraft.thePlayer.isUsingItem()) || (Minecraft.thePlayer.isBlocking())) && (!Venom.getInstance().getModuleManager().getModule(NoSlowdown.class).isEnabled()))
- {
- motionX *= 0.4000000059604645D;
- motionZ *= 0.4000000059604645D;
- }
- e.x = (forward * this.movementSpeed * mx + strafe * this.movementSpeed * mz);
- e.z = (forward * this.movementSpeed * mz - strafe * this.movementSpeed * mx);
- }
- Minecraft.thePlayer.stepHeight = 0.6F;
- if ((forward == 0.0F) && (strafe == 0.0F))
- {
- e.x = 0.0D;
- e.z = 0.0D;
- }
- else
- {
- boolean collideCheck = false;
- if (this.mc.theWorld.getCollidingBoundingBoxes(Minecraft.thePlayer, Minecraft.thePlayer.boundingBox.expand(0.1D, 0.1D, 0.1D)).size() > 0) {
- collideCheck = true;
- }
- if (forward != 0.0F)
- {
- if (strafe >= 1.0F)
- {
- yaw += (forward > 0.0F ? -45 : 45);
- strafe = 0.0F;
- }
- else if (strafe <= -1.0F)
- {
- yaw += (forward > 0.0F ? 45 : -45);
- strafe = 0.0F;
- }
- if (forward > 0.0F) {
- forward = 1.0F;
- } else if (forward < 0.0F) {
- forward = -1.0F;
- }
- }
- }
- }
- public static class BHOPCMD
- extends Command
- {
- public BHOPCMD()
- {
- super();
- }
- public void onCommand()
- {
- if (getArguments().length == 3)
- {
- if (getArguments()[1].equals("mode"))
- {
- if (getArguments()[2].equalsIgnoreCase("gomme1"))
- {
- Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "gomme1";
- ChatUtil.sendChatMessage("Mode set to �eGommeHD1");
- }
- else if (getArguments()[2].equals("hive"))
- {
- Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "hive";
- ChatUtil.sendChatMessage("Mode set to �eHiveMC");
- }
- else if (getArguments()[2].equals("gomme2"))
- {
- Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "gomme2";
- ChatUtil.sendChatMessage("Mode set to �eGommeHD2");
- }
- else if (getArguments()[2].equals("low"))
- {
- Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "low";
- ChatUtil.sendChatMessage("Mode set to �eLOW");
- }
- else if (getArguments()[2].equals("long"))
- {
- Venom.getInstance().getModuleManager().getModule(BunnyHop.class).getValue("mode").value = "long";
- ChatUtil.sendChatMessage("Mode set to �eLONG");
- }
- else
- {
- ChatUtil.sendChatMessage("�c.bhop help");
- }
- }
- else {
- ChatUtil.sendChatMessage("�c.bhop help");
- }
- }
- else if (getArguments().length == 2)
- {
- if (getArguments()[1].equalsIgnoreCase("help"))
- {
- ChatUtil.sendChatMessage("�c.bhop mode <gomme(1/2)/hive/low/long>");
- ChatUtil.sendChatMessage("�eSets the bhop mode.");
- }
- else
- {
- ChatUtil.sendChatMessage("�c.bhop help");
- }
- }
- else {
- ChatUtil.sendChatMessage("�c.bhop help");
- }
- super.onCommand();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement