Skip to content

Commit

Permalink
Auto Repellent quick fix
Browse files Browse the repository at this point in the history
Auto Repellent:
- Fixed buying Repellent Max, thanks mqtze!
  • Loading branch information
onixiya1337 authored Oct 15, 2024
2 parents decfb7d + d3060a0 commit 25389bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 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.10-pre1
version=2.8.10
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class FarmHelperConfig extends Config {
private transient static final String AUTO_PEST_EXCHANGE = "Auto Pest Exchange";
private transient static final String AUTO_GOD_POT = "Auto God Pot";
private transient static final String AUTO_SELL = "Auto Sell";
private transient static final String AUTO_REPELLANT = "Auto Repellant";
private transient static final String AUTO_REPELLENT = "Auto Repellent";
private transient static final String AUTO_SPRAYONATOR = "Auto Sprayonator";
private transient static final String DISCORD_INTEGRATION = "Discord Integration";
private transient static final String DELAYS = "Delays";
Expand Down Expand Up @@ -1716,29 +1716,29 @@ public static void triggerManuallyAutoPestExchange() {
public static String autoSellCustomItems = "";
//</editor-fold>

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

@DualOption(
name = "Pest Repellent Type", category = AUTO_REPELLANT, subcategory = "Pest Repellent",
name = "Pest Repellent Type", category = AUTO_REPELLENT, subcategory = "Pest Repellent",
description = "The pest repellent type to use",
left = "Pest Repellent",
right = "Pest Repellent MAX"
)
public static boolean pestRepellentType = true;

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

@Button(
name = "Reset Failsafe", category = AUTO_REPELLANT, subcategory = "Pest Repellent",
name = "Reset Failsafe", category = AUTO_REPELLENT, subcategory = "Pest Repellent",
text = "Click Here",
description = "Resets the failsafe timer for repellent"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ public void onTickExecution(TickEvent.ClientTickEvent event) {
if (InventoryUtils.hasItemInHotbar(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX")) {
LogUtils.sendDebug("Repellent in hotbar, selecting repellent");
state = State.SELECT_REPELLENT;
} else {
} else if (InventoryUtils.hasItemInInventory(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX")){
LogUtils.sendDebug("Repellent not in hotbar, moving to hotbar");
state = State.MOVE_REPELLENT;
} else {
LogUtils.sendDebug("Repellent not in inventory, buying");
state = State.NONE;
}
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
break;
Expand Down Expand Up @@ -383,7 +386,7 @@ public void onDrawGui(DrawScreenAfterEvent event) {
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
break;
}
Slot repellentSlot = InventoryUtils.getSlotOfItemInContainer(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX");
Slot repellentSlot = InventoryUtils.getSlotOfItemInContainer(!FarmHelperConfig.pestRepellentType || !InventoryUtils.hasItemInInventory("Pest Repellent") ? "Pest Repellent" : "Pest Repellent MAX");
if (repellentSlot == null) {
break;
}
Expand Down

0 comments on commit 25389bf

Please sign in to comment.