Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit 25389bf

Browse files
authored
Auto Repellent quick fix
Auto Repellent: - Fixed buying Repellent Max, thanks mqtze!
2 parents decfb7d + d3060a0 commit 25389bf

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
44
mcVersion=1.8.9
55
modid=farmhelperv2
66
modName=FarmHelper
7-
version=2.8.10-pre1
7+
version=2.8.10
88
shouldRelease=true

src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class FarmHelperConfig extends Config {
5454
private transient static final String AUTO_PEST_EXCHANGE = "Auto Pest Exchange";
5555
private transient static final String AUTO_GOD_POT = "Auto God Pot";
5656
private transient static final String AUTO_SELL = "Auto Sell";
57-
private transient static final String AUTO_REPELLANT = "Auto Repellant";
57+
private transient static final String AUTO_REPELLENT = "Auto Repellent";
5858
private transient static final String AUTO_SPRAYONATOR = "Auto Sprayonator";
5959
private transient static final String DISCORD_INTEGRATION = "Discord Integration";
6060
private transient static final String DELAYS = "Delays";
@@ -1716,29 +1716,29 @@ public static void triggerManuallyAutoPestExchange() {
17161716
public static String autoSellCustomItems = "";
17171717
//</editor-fold>
17181718

1719-
//<editor-fold desc="Pest Repellant">
1719+
//<editor-fold desc="Pest Repellent">
17201720
@Switch(
1721-
name = "Auto Pest Repellent", category = AUTO_REPELLANT, subcategory = "Pest Repellent",
1721+
name = "Auto Pest Repellent", category = AUTO_REPELLENT, subcategory = "Pest Repellent",
17221722
description = "Automatically uses pest repellent when it's not active"
17231723
)
17241724
public static boolean autoPestRepellent = false;
17251725

17261726
@DualOption(
1727-
name = "Pest Repellent Type", category = AUTO_REPELLANT, subcategory = "Pest Repellent",
1727+
name = "Pest Repellent Type", category = AUTO_REPELLENT, subcategory = "Pest Repellent",
17281728
description = "The pest repellent type to use",
17291729
left = "Pest Repellent",
17301730
right = "Pest Repellent MAX"
17311731
)
17321732
public static boolean pestRepellentType = true;
17331733

17341734
@Switch(
1735-
name = "Pause Auto Pest Repellent during Jacob's contest", category = AUTO_REPELLANT, subcategory = "Pest Repellent",
1735+
name = "Pause Auto Pest Repellent during Jacob's contest", category = AUTO_REPELLENT, subcategory = "Pest Repellent",
17361736
description = "Pauses auto pest repellent during Jacob's contest"
17371737
)
17381738
public static boolean pauseAutoPestRepellentDuringJacobsContest = false;
17391739

17401740
@Button(
1741-
name = "Reset Failsafe", category = AUTO_REPELLANT, subcategory = "Pest Repellent",
1741+
name = "Reset Failsafe", category = AUTO_REPELLENT, subcategory = "Pest Repellent",
17421742
text = "Click Here",
17431743
description = "Resets the failsafe timer for repellent"
17441744
)

src/main/java/com/jelly/farmhelperv2/feature/impl/AutoRepellent.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,12 @@ public void onTickExecution(TickEvent.ClientTickEvent event) {
203203
if (InventoryUtils.hasItemInHotbar(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX")) {
204204
LogUtils.sendDebug("Repellent in hotbar, selecting repellent");
205205
state = State.SELECT_REPELLENT;
206-
} else {
206+
} else if (InventoryUtils.hasItemInInventory(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX")){
207207
LogUtils.sendDebug("Repellent not in hotbar, moving to hotbar");
208208
state = State.MOVE_REPELLENT;
209+
} else {
210+
LogUtils.sendDebug("Repellent not in inventory, buying");
211+
state = State.NONE;
209212
}
210213
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
211214
break;
@@ -383,7 +386,7 @@ public void onDrawGui(DrawScreenAfterEvent event) {
383386
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
384387
break;
385388
}
386-
Slot repellentSlot = InventoryUtils.getSlotOfItemInContainer(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX");
389+
Slot repellentSlot = InventoryUtils.getSlotOfItemInContainer(!FarmHelperConfig.pestRepellentType || !InventoryUtils.hasItemInInventory("Pest Repellent") ? "Pest Repellent" : "Pest Repellent MAX");
387390
if (repellentSlot == null) {
388391
break;
389392
}

0 commit comments

Comments
 (0)