Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher committed May 15, 2024
1 parent ba6d859 commit ffa8bd9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ public static void doAttack() throws InterruptedException {
attackEntity(TargetController.getTarget());
}

public static void doJump() throws InterruptedException {
KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.jumpKey, true);
Thread.sleep(WAIT_TIME);
KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.jumpKey, false);
}

public static void doSprint() throws InterruptedException {
KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.sprintKey, true);
Thread.sleep(WAIT_TIME);
KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.sprintKey, false);
}

public static void doScreenshot() throws InterruptedException {
KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.screenshotKey, true);
Thread.sleep(WAIT_TIME);
KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.sprintKey, false);
}
// public static void doJump() throws InterruptedException {
// KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.jumpKey, true);
// Thread.sleep(WAIT_TIME);
// KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.jumpKey, false);
// }
//
// public static void doSprint() throws InterruptedException {
// KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.sprintKey, true);
// Thread.sleep(WAIT_TIME);
// KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.sprintKey, false);
// }
//
// public static void doScreenshot() throws InterruptedException {
// KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.screenshotKey, true);
// Thread.sleep(WAIT_TIME);
// KeyBindingController.setKeyBindingPressed(MinecraftClient.getInstance().options.sprintKey, false);
// }

private static final double MAX_REACH = 3.0;
private static void attackEntity(Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private static void initializing() {
private static void doMainLogic() throws InterruptedException {
targetMonitor.tick();
teleportMonitor.tick();
disconnectMonitor.tick();
portalMonitor.tick();
walkToTargetMonitor.tick();
lookAtTargetMonitor.tick();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.clatza.mcautofight.Monitors;

import dev.clatza.mcautofight.Controllers.StateController;
import dev.clatza.mcautofight.Controllers.TargetController;
import dev.clatza.mcautofight.GlobalData;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.minecraft.client.MinecraftClient;
Expand All @@ -17,4 +18,7 @@ private void stop() {
StateController.setAutoFight(false);
if (GlobalData.DEBUG) System.out.println("[DEBUG][DisconnectMonitor] Disconnected from server. AutoFight stopped.");
}

public void tick() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void tick() {
if (TargetController.getTarget().isRemoved()) return;

double distanceToEntity = player.getPos().distanceTo(TargetController.getTarget().getPos());
double distanceToTarget = player.getPos().distanceTo(PathFindingGoal);;
double distanceToTarget = player.getPos().distanceTo(PathFindingGoal);

//We have a new target. Stop all movements and start moving to the new target
if(!TargetController.getTarget().getEntityName().equals(currentEntityName)){
Expand Down

0 comments on commit ffa8bd9

Please sign in to comment.