Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelly298 committed Apr 4, 2022
1 parent 076dc0d commit 5a62d14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/main/java/FarmHelper/FarmHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ public void OnTickPlayer(TickEvent.ClientTickEvent event) { //Client -> player
} else {
mc.thePlayer.rotationPitch = 6;
}
mc.thePlayer.rotationYaw = playerYaw;

Utils.hardRotate(playerYaw);


}
Expand Down Expand Up @@ -447,7 +448,7 @@ public void run() {
Thread.sleep(500);
Config.Angle = Config.Angle.ordinal() < 2 ? AngleEnum.values()[Config.Angle.ordinal() + 2] : AngleEnum.values()[Config.Angle.ordinal() - 2];
playerYaw = angleToValue(Config.Angle);
mc.thePlayer.rotationYaw = playerYaw;
Utils.hardRotate(playerYaw);
Thread.sleep(500);
rotating = false;

Expand Down Expand Up @@ -590,7 +591,8 @@ public void OnKeyPress(InputEvent.KeyInputEvent event){
if(!rotating) {
if (customKeyBinds[0].isPressed()) {
openedGUI = true;
mc.displayGuiScreen(new GUI());
mc.displayGuiScreen(new GUI());

}
if (customKeyBinds[1].isPressed()) {
if (!enabled)
Expand Down Expand Up @@ -640,6 +642,7 @@ void toggle(){
} else {
playerYaw = angleToValue(Config.Angle);
}

enabled = !enabled;
openedGUI = false;
}
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/FarmHelper/Utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ public static void drawString(String text, int x, int y, float size, int color)
//GL11.glScalef(mSize,mSize,mSize);

}
public static void hardRotate(float yaw) {
Minecraft mc = Minecraft.getMinecraft();
if(Math.abs(mc.thePlayer.rotationYaw - yaw) < 0.2f) {
mc.thePlayer.rotationYaw = yaw;
return;
}
while(mc.thePlayer.rotationYaw > yaw) {
mc.thePlayer.rotationYaw -= 0.1f;
}
while(mc.thePlayer.rotationYaw < yaw) {
mc.thePlayer.rotationYaw += 0.1f;

public static void saveConfig(Config c){


}
}


Expand Down

0 comments on commit 5a62d14

Please sign in to comment.