diff --git a/README.md b/README.md index bc3ac34..51f473f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ You can access the mod by using the default keybind (right shift). - Chest ESP - Popup Animations - Giant Models + - Trajectories - Chinese Hat - Animations - Animator @@ -33,6 +34,7 @@ You can access the mod by using the default keybind (right shift). - Velocity - FreeCam - Movement + - Bunny Hop - Safe Walk - Gui Move - Combat diff --git a/src/main/java/net/kore/Kore.java b/src/main/java/net/kore/Kore.java index bdcf0f8..91fc06e 100644 --- a/src/main/java/net/kore/Kore.java +++ b/src/main/java/net/kore/Kore.java @@ -5,8 +5,7 @@ import net.kore.modules.Module; import net.kore.modules.combat.*; import net.kore.modules.misc.*; -import net.kore.modules.movement.GuiMove; -import net.kore.modules.movement.SafeWalk; +import net.kore.modules.movement.*; import net.kore.modules.skyblock.*; import net.kore.modules.player.*; import net.kore.modules.protection.*; @@ -65,6 +64,7 @@ public class Kore { public static ChestESP chestESP; public static PopupAnimation popupAnimation; public static Trail trail; + public static Trajectories trajectories; // Combat public static AntiBot antiBot; @@ -82,6 +82,7 @@ public class Kore { public static Velocity velocity; // Movement + public static BunnyHop bunnyHop; public static GuiMove guiMove; public static SafeWalk safeWalk; diff --git a/src/main/java/net/kore/mixins/player/MixinEntityLivingBase.java b/src/main/java/net/kore/mixins/player/MixinEntityLivingBase.java index 29edaf3..b019ab7 100644 --- a/src/main/java/net/kore/mixins/player/MixinEntityLivingBase.java +++ b/src/main/java/net/kore/mixins/player/MixinEntityLivingBase.java @@ -24,7 +24,6 @@ public abstract class MixinEntityLivingBase extends MixinEntity protected abstract void jump(); @Shadow private Map activePotionsMap; - @Shadow public abstract ItemStack getHeldItem(); @Shadow diff --git a/src/main/java/net/kore/modules/combat/AutoClicker.java b/src/main/java/net/kore/modules/combat/AutoClicker.java index f223d4e..ec50a1c 100644 --- a/src/main/java/net/kore/modules/combat/AutoClicker.java +++ b/src/main/java/net/kore/modules/combat/AutoClicker.java @@ -6,6 +6,7 @@ import net.kore.settings.NumberSetting; import net.kore.utils.MathUtils; import net.kore.utils.MilliTimer; +import net.kore.utils.PlayerUtils; import net.kore.utils.SkyblockUtils; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; @@ -37,7 +38,7 @@ public void onTick(final RenderWorldLastEvent event) { if (this.isToggled() && Kore.mc.thePlayer != null && this.isPressed() && !Kore.mc.thePlayer.isUsingItem() && Kore.mc.currentScreen == null && this.timer.hasTimePassed((long)(1000.0 / this.nextDelay))) { this.timer.reset(); this.nextDelay = MathUtils.getRandomInRange(AutoClicker.maxCps.getValue(), AutoClicker.minCps.getValue()); - SkyblockUtils.click(); + PlayerUtils.click(); } } diff --git a/src/main/java/net/kore/modules/movement/BunnyHop.java b/src/main/java/net/kore/modules/movement/BunnyHop.java new file mode 100644 index 0000000..fd95bc6 --- /dev/null +++ b/src/main/java/net/kore/modules/movement/BunnyHop.java @@ -0,0 +1,50 @@ +package net.kore.modules.movement; + +import net.kore.Kore; +import net.kore.events.MotionUpdateEvent; +import net.kore.modules.Module; +import net.kore.settings.BooleanSetting; +import net.kore.settings.NumberSetting; +import net.kore.utils.MovementUtils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class BunnyHop extends Module { + public NumberSetting speed; + public BooleanSetting fastFall; + + public BunnyHop() { + super("Bunny Hop", Category.MOVEMENT); + this.speed = new NumberSetting("Speed", 2, 1, 10, 0.2); + this.fastFall = new BooleanSetting("Fast Fall", false); + this.addSettings(this.speed, this.fastFall); + this.setFlagType(FlagType.DETECTED); + } + + @Override + public void assign() + { + Kore.bunnyHop = this; + } + + @SubscribeEvent + public void onMoveInput(MotionUpdateEvent e) { + if(!this.isToggled()) return; + + if (MovementUtils.isMoving() && !Kore.mc.thePlayer.isInWater()) { + if (Kore.mc.thePlayer.onGround) { + Kore.mc.thePlayer.jump(); + } + + if (fastFall.isEnabled()) { + if (Kore.mc.thePlayer.fallDistance < 2 && Kore.mc.thePlayer.fallDistance > 0) { + Kore.mc.thePlayer.motionY *= 1.5; + } + } + + Kore.mc.thePlayer.setSprinting(true); + double spd = 0.01D * speed.getValue(); + double m = (float)(Math.sqrt(Kore.mc.thePlayer.motionX * Kore.mc.thePlayer.motionX + Kore.mc.thePlayer.motionZ * Kore.mc.thePlayer.motionZ) + spd); + MovementUtils.bhop(m); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/kore/modules/combat/NoSlow.java b/src/main/java/net/kore/modules/movement/NoSlow.java similarity index 97% rename from src/main/java/net/kore/modules/combat/NoSlow.java rename to src/main/java/net/kore/modules/movement/NoSlow.java index 1da666c..b719002 100644 --- a/src/main/java/net/kore/modules/combat/NoSlow.java +++ b/src/main/java/net/kore/modules/movement/NoSlow.java @@ -1,4 +1,4 @@ -package net.kore.modules.combat; +package net.kore.modules.movement; import net.kore.Kore; import net.kore.events.MotionUpdateEvent; @@ -27,7 +27,7 @@ public class NoSlow extends Module private final MilliTimer blockDelay; public NoSlow() { - super("No Slow", 0, Category.COMBAT); + super("No Slow", 0, Category.MOVEMENT); this.eatingSlowdown = new NumberSetting("Eating slow", 1.0, 0.2, 1.0, 0.1); this.swordSlowdown = new NumberSetting("Sword slow", 1.0, 0.2, 1.0, 0.1); this.bowSlowdown = new NumberSetting("Bow slow", 1.0, 0.2, 1.0, 0.1); diff --git a/src/main/java/net/kore/modules/render/Trajectories.java b/src/main/java/net/kore/modules/render/Trajectories.java new file mode 100644 index 0000000..b9a2c73 --- /dev/null +++ b/src/main/java/net/kore/modules/render/Trajectories.java @@ -0,0 +1,127 @@ +package net.kore.modules.render; + +import net.kore.Kore; +import net.kore.modules.Module; +import net.kore.settings.NumberSetting; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.item.ItemBow; +import net.minecraft.util.Timer; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.RenderWorldEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class Trajectories extends Module { + + public NumberSetting width; + + public Trajectories() { + super("Trajectories", Category.RENDER); + this.width = new NumberSetting("Thickness", 2, 1, 10, 1); + this.addSettings(this.width); + } + + @Override + public void assign() + { + Kore.trajectories = this; + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent e) { + if (!this.isToggled() || Kore.mc.thePlayer == null || Kore.mc.theWorld == null) return; + if (!(Kore.mc.thePlayer.isUsingItem() && Kore.mc.thePlayer.getHeldItem().getItem() instanceof ItemBow)) return; + + EntityPlayerSP player = Kore.mc.thePlayer; + + Timer timer = new Timer(3F); + double arrowPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * timer.renderPartialTicks + - Math.cos((float) Math.toRadians(player.rotationYaw)) * 0.16F; + double arrowPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * timer.renderPartialTicks + + player.getEyeHeight() - 0.1; + double arrowPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * timer.renderPartialTicks + - Math.sin((float) Math.toRadians(player.rotationYaw)) * 0.16F; + + float arrowMotionFactor = 1F; + float yaw = (float) Math.toRadians(player.rotationYaw); + float pitch = (float) Math.toRadians(player.rotationPitch); + float arrowMotionX = (float) (-Math.sin(yaw) * Math.cos(pitch) * arrowMotionFactor); + float arrowMotionY = (float) (-Math.sin(pitch) * arrowMotionFactor); + float arrowMotionZ = (float) (Math.cos(yaw) * Math.cos(pitch) * arrowMotionFactor); + double arrowMotion = Math + .sqrt(arrowMotionX * arrowMotionX + arrowMotionY * arrowMotionY + arrowMotionZ * arrowMotionZ); + arrowMotionX /= (float) arrowMotion; + arrowMotionY /= (float) arrowMotion; + arrowMotionZ /= (float) arrowMotion; + float bowPower = (72000 - player.getItemInUseCount()) / 20F; + bowPower = (bowPower * bowPower + bowPower * 2F) / 3F; + + if (bowPower > 1F || bowPower <= 0.1F) + bowPower = 1F; + + bowPower *= 3F; + arrowMotionX *= bowPower; + arrowMotionY *= bowPower; + arrowMotionZ *= bowPower; + + // GL settings + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glLineWidth((int) width.getValue()); + + RenderManager renderManager = Kore.mc.getRenderManager(); + + double gravity = 0.05D; + Vec3 playerVector = new Vec3(player.posX, player.posY + player.getEyeHeight(), player.posZ); + final Color color = Kore.clickGui.getColor(); + GL11.glColor4f(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, 0.75f); + GL11.glBegin(GL11.GL_LINE_STRIP); + for (int i = 0; i < 1000; i++) { + GL11.glVertex3d(arrowPosX - renderManager.viewerPosX, arrowPosY - renderManager.viewerPosY, + arrowPosZ - renderManager.viewerPosZ); + + arrowPosX += arrowMotionX * 0.1; + arrowPosY += arrowMotionY * 0.1; + arrowPosZ += arrowMotionZ * 0.1; + arrowMotionX *= 0.999F; + arrowMotionY *= 0.999F; + arrowMotionZ *= 0.999F; + arrowMotionY -= (float) (gravity * 0.1); + + if (Kore.mc.theWorld.rayTraceBlocks(playerVector, new Vec3(arrowPosX, arrowPosY, arrowPosZ)) != null) + break; + } + GL11.glEnd(); + + double renderX = arrowPosX - renderManager.viewerPosX; + double renderY = arrowPosY - renderManager.viewerPosY; + double renderZ = arrowPosZ - renderManager.viewerPosZ; + + GL11.glPushMatrix(); + GL11.glTranslated(renderX - 0.5, renderY - 0.5, renderZ - 0.5); + + GL11.glColor4f(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, 0.25f); + GL11.glColor4f(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, 0.75f); + + GL11.glPopMatrix(); + + // GL resets + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + GL11.glPopMatrix(); + + } +} \ No newline at end of file diff --git a/src/main/java/net/kore/utils/MovementUtils.java b/src/main/java/net/kore/utils/MovementUtils.java index 1a84037..96389ab 100644 --- a/src/main/java/net/kore/utils/MovementUtils.java +++ b/src/main/java/net/kore/utils/MovementUtils.java @@ -44,6 +44,37 @@ public static void strafe(final double speed) { MovementUtils.strafeTimer.reset(); } + public static void bhop(double s) { + double forward = Kore.mc.thePlayer.movementInput.moveForward; + double strafe = Kore.mc.thePlayer.movementInput.moveStrafe; + float yaw = Kore.mc.thePlayer.rotationYaw; + + if ((forward == 0.0D) && (strafe == 0.0D)) { + Kore.mc.thePlayer.motionX = 0.0D; + Kore.mc.thePlayer.motionZ = 0.0D; + } else { + if (forward != 0.0D) { + if (strafe > 0.0D) + yaw += (float) (forward > 0.0D ? -45 : 45); + else if (strafe < 0.0D) + yaw += (float) (forward > 0.0D ? 45 : -45); + + strafe = 0.0D; + if (forward > 0.0D) + forward = 1.0D; + else if (forward < 0.0D) + forward = -1.0D; + } + + double rad = Math.toRadians(yaw + 90.0F); + double sin = Math.sin(rad); + double cos = Math.cos(rad); + Kore.mc.thePlayer.motionX = (forward * s * cos) + (strafe * s * sin); + Kore.mc.thePlayer.motionZ = (forward * s * sin) - (strafe * s * cos); + } + + } + public static void strafe(final float speed, final float yaw) { if (!isMoving() || !MovementUtils.strafeTimer.hasTimePassed(150L)) { return; diff --git a/src/main/java/net/kore/utils/PlayerUtils.java b/src/main/java/net/kore/utils/PlayerUtils.java index 00c5152..0d8f603 100644 --- a/src/main/java/net/kore/utils/PlayerUtils.java +++ b/src/main/java/net/kore/utils/PlayerUtils.java @@ -43,30 +43,34 @@ public static boolean isNPC(final Entity entity) { return ChatFormatting.stripFormatting(entity.getDisplayName().getUnformattedText()).startsWith("[NPC]") || (entity.getUniqueID().version() == 2 && entityLivingBase.getHealth() == 20.0f && entityLivingBase.getMaxHealth() == 20.0f); } - public static void click() - { - if (clickMouse != null) - { + public static void click() { + try { + Method clickMouse; try { - clickMouse.invoke(Kore.mc); - } catch (Exception e) - { - e.printStackTrace(); + clickMouse = Minecraft.class.getDeclaredMethod("clickMouse", (Class[])new Class[0]); } - - return; + catch (NoSuchMethodException e2) { + clickMouse = Minecraft.class.getDeclaredMethod("clickMouse", (Class[])new Class[0]); + } + clickMouse.setAccessible(true); + clickMouse.invoke(Minecraft.getMinecraft(), new Object[0]); } + catch (Exception e) { + e.printStackTrace(); + } + } + + public static void rightClick() { try { + Method rightClickMouse = null; try { - clickMouse = Minecraft.class.getDeclaredMethod("clickMouse"); + rightClickMouse = Minecraft.class.getDeclaredMethod("rightClickMouse", (Class[])new Class[0]); } catch (NoSuchMethodException e2) { - e2.printStackTrace(); - } - if(clickMouse != null) { - clickMouse.setAccessible(true); - clickMouse.invoke(Minecraft.getMinecraft(), new Object[0]); + rightClickMouse = Minecraft.class.getDeclaredMethod("rightClickMouse", (Class[])new Class[0]); } + rightClickMouse.setAccessible(true); + rightClickMouse.invoke(Minecraft.getMinecraft(), new Object[0]); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/net/kore/utils/SkyblockUtils.java b/src/main/java/net/kore/utils/SkyblockUtils.java index 5894877..443df29 100644 --- a/src/main/java/net/kore/utils/SkyblockUtils.java +++ b/src/main/java/net/kore/utils/SkyblockUtils.java @@ -236,39 +236,5 @@ public static T firstOrNull(final Iterable iterable) { public static boolean isTerminal(final String name) { return name.contains("Correct all the panes!") || name.contains("Navigate the maze!") || name.contains("Click in order!") || name.contains("What starts with:") || name.contains("Select all the") || name.contains("Change all to same color!") || name.contains("Click the button on time!"); } - - public static void click() { - try { - Method clickMouse; - try { - clickMouse = Minecraft.class.getDeclaredMethod("clickMouse", (Class[])new Class[0]); - } - catch (NoSuchMethodException e2) { - clickMouse = Minecraft.class.getDeclaredMethod("clickMouse", (Class[])new Class[0]); - } - clickMouse.setAccessible(true); - clickMouse.invoke(Minecraft.getMinecraft(), new Object[0]); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void rightClick() { - try { - Method rightClickMouse = null; - try { - rightClickMouse = Minecraft.class.getDeclaredMethod("rightClickMouse", (Class[])new Class[0]); - } - catch (NoSuchMethodException e2) { - rightClickMouse = Minecraft.class.getDeclaredMethod("rightClickMouse", (Class[])new Class[0]); - } - rightClickMouse.setAccessible(true); - rightClickMouse.invoke(Minecraft.getMinecraft(), new Object[0]); - } - catch (Exception e) { - e.printStackTrace(); - } - } }