From af6faf0110afa6d32f514d12c2b4faa9f4ce9493 Mon Sep 17 00:00:00 2001 From: onixiya1337 <47077455+onixiya1337@users.noreply.github.com> Date: Sat, 16 Dec 2023 13:31:26 +0100 Subject: [PATCH] Probably fixed baritone stuff --- .../jelly/farmhelperv2/config/FarmHelperConfig.java | 6 +++--- .../farmhelperv2/feature/impl/PestsDestroyer.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java index f8f93d0e..1b09d23a 100644 --- a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java +++ b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java @@ -1155,13 +1155,13 @@ public static void triggerManuallyPestsDestroyer() { @Switch( name = "Enable Pests Destroyer Pathfinding for medium distances", category = PESTS_DESTROYER, subcategory = "Pathfinding", description = "Enables the pests destroyer pathfinding for medium distances", - size = 1 + size = 2 ) public static boolean enablePestsDestroyerPathfindingMediumDistances = true; @Switch( - name = "Enable Pests Destroyer Pathfinding for longer distances", category = PESTS_DESTROYER, subcategory = "Pathfinding", + name = "Enable Pests Destroyer Pathfinding for longer distances (not recommended)", category = PESTS_DESTROYER, subcategory = "Pathfinding", description = "Enables the pests destroyer pathfinding for longer distances", - size = 1 + size = 2 ) public static boolean enablePestsDestroyerPathfindingLongerDistances = false; // diff --git a/src/main/java/com/jelly/farmhelperv2/feature/impl/PestsDestroyer.java b/src/main/java/com/jelly/farmhelperv2/feature/impl/PestsDestroyer.java index 69e2cfda..4060426a 100644 --- a/src/main/java/com/jelly/farmhelperv2/feature/impl/PestsDestroyer.java +++ b/src/main/java/com/jelly/farmhelperv2/feature/impl/PestsDestroyer.java @@ -605,13 +605,13 @@ public void onTickExecute(TickEvent.ClientTickEvent event) { } KeyBindUtils.holdThese(mc.gameSettings.keyBindUseItem); } else if (((distance <= 10 || distanceXZ <= 2) && !FarmHelperConfig.enablePestsDestroyerPathfindingMediumDistances) - || ((distanceXZ <= 10) && FarmHelperConfig.enablePestsDestroyerPathfindingMediumDistances)) { + || (!FlyPathfinder.getInstance().hasFailed && distanceXZ <= 10 && FarmHelperConfig.enablePestsDestroyerPathfindingMediumDistances)) { if (!mc.thePlayer.capabilities.isFlying) { flyAwayFromGround(); delayClock.schedule(350); break; } - if (FarmHelperConfig.enablePestsDestroyerPathfindingMediumDistances) { + if (FarmHelperConfig.enablePestsDestroyerPathfindingMediumDistances && !FlyPathfinder.getInstance().hasFailed) { flyPathfinding(entity); break; } else { @@ -635,7 +635,7 @@ public void onTickExecute(TickEvent.ClientTickEvent event) { } } else { cantReachPest = 0; - if (FarmHelperConfig.enablePestsDestroyerPathfindingLongerDistances) { + if (FarmHelperConfig.enablePestsDestroyerPathfindingLongerDistances && !FlyPathfinder.getInstance().hasFailed) { flyPathfinding(entity); } else { if (distanceXZ < 6 && distance > 10 && mc.thePlayer.capabilities.isFlying) { @@ -712,9 +712,9 @@ private void flyPathfinding(Entity entity) { return; } if (FlyPathfinder.getInstance().hasGoal() && FlyPathfinder.getInstance().hasFailed) { - LogUtils.sendError("[Pests Destroyer] Failed to get path to " + FlyPathfinder.getInstance().getGoal()); + LogUtils.sendWarning("[Pests Destroyer] Failed to get path to " + FlyPathfinder.getInstance().getGoal() + ". Falling back to normal flying behavior."); FlyPathfinder.getInstance().stop(); - escapeState = EscapeState.GO_TO_HUB; +// escapeState = EscapeState.GO_TO_HUB; KeyBindUtils.stopMovement(); delayClock.schedule(300); return;