diff --git a/gradle.properties b/gradle.properties index 9be6f395..f31384eb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java index c9e930c9..f5102491 100644 --- a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java +++ b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java @@ -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"; @@ -1716,15 +1716,15 @@ public static void triggerManuallyAutoPestExchange() { public static String autoSellCustomItems = ""; // - // + // @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" @@ -1732,13 +1732,13 @@ public static void triggerManuallyAutoPestExchange() { 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" ) diff --git a/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoRepellent.java b/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoRepellent.java index f88ca19a..82159be4 100644 --- a/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoRepellent.java +++ b/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoRepellent.java @@ -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; @@ -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; }