Skip to content

Commit

Permalink
Macros:
Browse files Browse the repository at this point in the history
 = No micro rotation fix

Failsafes:
 = Test failsafes should work

Auto Repellent:
 = Fixes
  • Loading branch information
May2Beez committed Apr 28, 2024
1 parent cb54f09 commit f7f6db2
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.6.9
version=2.6.10
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.jelly.farmhelperv2.config.page.FailsafeNotificationsPage;
import com.jelly.farmhelperv2.config.struct.Rewarp;
import com.jelly.farmhelperv2.failsafe.FailsafeManager;
import com.jelly.farmhelperv2.failsafe.impl.EvacuateFailsafe;
import com.jelly.farmhelperv2.failsafe.impl.LowerAvgBpsFailsafe;
import com.jelly.farmhelperv2.feature.impl.*;
import com.jelly.farmhelperv2.handler.GameStateHandler;
Expand Down Expand Up @@ -485,12 +484,12 @@ public class FarmHelperConfig extends Config {
}
LogUtils.sendWarning("Testing failsafe...");
PlayerUtils.closeScreen();
if (testFailsafeTypeSelected == 0)
if (testFailsafeTypeSelected == 0) {
FailsafeManager.getInstance().possibleDetection(FailsafeManager.getInstance().failsafes.get(testFailsafeTypeSelected));
else if (testFailsafeTypeSelected != 6)
return;
} else if (testFailsafeTypeSelected != 6)
LowerAvgBpsFailsafe.getInstance().clearQueue(); // Clear the queue to avoid false positives
else
FailsafeManager.getInstance().possibleDetection(FailsafeManager.getInstance().failsafes.get(testFailsafeTypeSelected + 2));
FailsafeManager.getInstance().possibleDetection(FailsafeManager.getInstance().failsafes.get(testFailsafeTypeSelected + 2));
};

@Dropdown(
Expand All @@ -505,6 +504,7 @@ else if (testFailsafeTypeSelected != 6)
"Guest Visit",
"Item Change Check",
"Jacob",
"Knockback Check",
"Lower Average Bps",
"Rotation Check",
"Teleport Check",
Expand Down Expand Up @@ -2073,8 +2073,6 @@ public FarmHelperConfig() {
registerKeyBind(openGuiKeybind, this::openGui);
registerKeyBind(toggleMacro, () -> MacroHandler.getInstance().toggleMacro());
registerKeyBind(debugKeybind, () -> {

FailsafeManager.getInstance().possibleDetection(EvacuateFailsafe.getInstance());
});
registerKeyBind(freelookKeybind, () -> Freelook.getInstance().toggle());
registerKeyBind(plotCleaningHelperKeybind, () -> PlotCleaningHelper.getInstance().toggle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ public void start() {
@Override
public void stop() {
if (enabled)
LogUtils.sendWarning("[Auto Repellent] Disabled! Resuming macro in 1.5 seconds...");
LogUtils.sendWarning("[Auto Repellent] Disabled! Resuming macro...");
PlayerUtils.closeScreen();
notEnoughCopper = false;
state = State.NONE;
PlayerUtils.closeScreen();
enabled = false;
Multithreading.schedule(() -> {
MacroHandler.getInstance().resumeMacro();
enabled = false;
IFeature.super.stop();
}, 500, TimeUnit.MILLISECONDS);
IFeature.super.stop();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void onEnable() {
}
if (MacroHandler.getInstance().isTeleporting()) return;
setRestoredState(false);
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
new Rotation(getYaw(), getPitch()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void onEnable() {
changeLaneDirection = null;
if (MacroHandler.getInstance().isTeleporting()) return;
setRestoredState(false);
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
new Rotation((getClosest90Deg().orElse(AngleUtils.getClosest())) + additionalRotation, getPitch()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void onEnable() {
}
if (MacroHandler.getInstance().isTeleporting()) return;
setRestoredState(false);
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
new Rotation(getYaw(), getPitch()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void onEnable() {
}
if (MacroHandler.getInstance().isTeleporting()) return;
setRestoredState(false);
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
new Rotation((float) (getClosest90Deg().orElse(AngleUtils.getClosest()) + (getCurrentState() == State.LEFT ? -30 : 30) + (Math.random() * 4 - 2)), getPitch()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ public void onEnable() {
if (MacroHandler.getInstance().isTeleporting()) return;
setRestoredState(false);
Rotation newRotation = new Rotation((float) (getClosest90Deg().orElse(AngleUtils.getClosest()) + -16 + (Math.random() * 1 - 0.5)), getPitch());
setYaw(newRotation.getYaw());
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
newRotation,
FarmHelperConfig.getRandomRotationTime(), null
).easeOutBack(!MacroHandler.getInstance().isResume())
);

setYaw(newRotation.getYaw());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void onEnable() {
rowStartZ = mc.thePlayer.posZ;
if (MacroHandler.getInstance().isTeleporting()) return;
setRestoredState(false);
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
new Rotation(getYaw(), getPitch()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public void onEnable() {
}
setRestoredState(false);
if (MacroHandler.getInstance().isTeleporting()) return;
if (FarmHelperConfig.dontFixAfterWarping && Math.abs(getYaw() - AngleUtils.get360RotationYaw()) < 0.1) return;
getRotation().easeTo(
new RotationConfiguration(
new Rotation(getYaw(), getPitch()),
Expand Down

0 comments on commit f7f6db2

Please sign in to comment.