Skip to content

Commit

Permalink
Update: trajectories & bhop
Browse files Browse the repository at this point in the history
  • Loading branch information
valekatoz committed Feb 22, 2024
1 parent 6e41e74 commit 2a7cc74
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 56 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/kore/Kore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -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;
Expand All @@ -82,6 +82,7 @@ public class Kore {
public static Velocity velocity;

// Movement
public static BunnyHop bunnyHop;
public static GuiMove guiMove;
public static SafeWalk safeWalk;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public abstract class MixinEntityLivingBase extends MixinEntity
protected abstract void jump();
@Shadow
private Map<Integer, PotionEffect> activePotionsMap;

@Shadow
public abstract ItemStack getHeldItem();
@Shadow
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/kore/modules/combat/AutoClicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}

Expand Down
50 changes: 50 additions & 0 deletions src/main/java/net/kore/modules/movement/BunnyHop.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.kore.modules.combat;
package net.kore.modules.movement;

import net.kore.Kore;
import net.kore.events.MotionUpdateEvent;
Expand Down Expand Up @@ -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);
Expand Down
127 changes: 127 additions & 0 deletions src/main/java/net/kore/modules/render/Trajectories.java
Original file line number Diff line number Diff line change
@@ -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();

}
}
31 changes: 31 additions & 0 deletions src/main/java/net/kore/utils/MovementUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
36 changes: 20 additions & 16 deletions src/main/java/net/kore/utils/PlayerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
34 changes: 0 additions & 34 deletions src/main/java/net/kore/utils/SkyblockUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,39 +236,5 @@ public static <T> T firstOrNull(final Iterable<T> 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();
}
}
}

0 comments on commit 2a7cc74

Please sign in to comment.