Skip to content

Commit

Permalink
Fixed testing failsafes
Browse files Browse the repository at this point in the history
  • Loading branch information
onixiya1337 committed Aug 31, 2024
1 parent 5f35df4 commit cc97aef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 33 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.8.9-pre7
version=2.8.9-pre8
shouldRelease=true
16 changes: 12 additions & 4 deletions src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import com.jelly.farmhelperv2.config.page.CustomFailsafeMessagesPage;
import com.jelly.farmhelperv2.config.page.FailsafeNotificationsPage;
import com.jelly.farmhelperv2.config.struct.Rewarp;
import com.jelly.farmhelperv2.failsafe.Failsafe;
import com.jelly.farmhelperv2.failsafe.FailsafeManager;
import com.jelly.farmhelperv2.failsafe.impl.BedrockCageFailsafe;
import com.jelly.farmhelperv2.failsafe.impl.DirtFailsafe;
import com.jelly.farmhelperv2.feature.impl.*;
import com.jelly.farmhelperv2.feature.impl.Proxy.ProxyType;
import com.jelly.farmhelperv2.gui.AutoUpdaterGUI;
Expand Down Expand Up @@ -485,25 +488,30 @@ public class FarmHelperConfig extends Config {
}
LogUtils.sendWarning("Testing failsafe...");
PlayerUtils.closeScreen();
if (testFailsafeType == 0) {
FailsafeManager.getInstance().possibleDetection(FailsafeManager.getInstance().failsafes.get(testFailsafeType));
Failsafe testingFailsafe = FailsafeManager.getInstance().failsafes.get(testFailsafeType);
if (testingFailsafe.equals(DirtFailsafe.getInstance()) || testingFailsafe.equals(BedrockCageFailsafe.getInstance())) {
LogUtils.sendError("You can't test this failsafe because it requires specific conditions to trigger!");
return;
}
FailsafeManager.getInstance().possibleDetection(FailsafeManager.getInstance().failsafes.get(testFailsafeType + 2));
FailsafeManager.getInstance().possibleDetection(testingFailsafe);
};

@Dropdown(name = "Test Failsafe Type", category = FAILSAFE, subcategory = "Testing",
description = "Select failsafe scenario to test",
options = {
"Bad Effects",
"Banwave",
"Bedrock Cage",
"Cobweb",
"Dirt",
"Disconnect",
"Evacuate",
"Full Inventory",
"Guest Visit",
"Item Change",
"Jacob",
"Knockback",
"Low BPS",
"Lower Average BPS",
"Rotation",
"Teleport",
"World Change"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ public class FailsafeNotificationsPage {
)
public static boolean notifyOnJacobFailsafe = false;

@Switch(
name = "Test Notifications",
description = "Whether or not to send a notification when the Test failsafe is triggered.",
category = "Failsafe Notifications"
)
public static boolean notifyOnTestFailsafe = true;

@Switch(
name = "Lower Average BPS Notifications",
description = "Whether or not to send a notification when the average BPS is lower than the specified value.",
Expand Down Expand Up @@ -227,13 +220,6 @@ public class FailsafeNotificationsPage {
)
public static boolean alertOnFullInventory = false;

@Switch(
name = "Test Alert",
description = "Whether or not to play a sound when the Test failsafe is triggered.",
category = "Failsafe Sound Alerts"
)
public static boolean alertOnTestFailsafe = true;

@Switch(
name = "Lower Average BPS Alert",
description = "Whether or not to play a sound when the average BPS is lower than the specified value.",
Expand Down Expand Up @@ -347,13 +333,6 @@ public class FailsafeNotificationsPage {
)
public static boolean tagEveryoneOnJacobFailsafe = false;

@Switch(
name = "Test Tag Everyone",
description = "Whether or not to tag everyone in the webhook message when the Test failsafe is triggered.",
category = "Failsafe Tag Everyone"
)
public static boolean tagEveryoneOnTestFailsafe = true;

@Switch(
name = "Lower Average BPS Tag Everyone",
description = "Whether or not to tag everyone in the webhook message when the average BPS is lower than the specified value.",
Expand Down Expand Up @@ -466,13 +445,6 @@ public class FailsafeNotificationsPage {
)
public static boolean autoAltTabOnJacobFailsafe = false;

@Switch(
name = "Test Auto Alt-tab",
description = "Whether or not to automatically alt-tab when the Test failsafe is triggered.",
category = "Failsafe Auto Alt-tab"
)
public static boolean autoAltTabOnTestFailsafe = true;

@Switch(
name = "Lower Average BPS Alt-tab",
description = "Whether or not to automatically alt-tab when the average BPS is lower than the specified value.",
Expand Down

0 comments on commit cc97aef

Please sign in to comment.