From b10fc13cfc7bf9dd191219f5f93337125907a6dd Mon Sep 17 00:00:00 2001 From: martimavocado <39881008+martimavocado@users.noreply.github.com> Date: Tue, 1 Oct 2024 22:05:00 +0100 Subject: Improvement: Add ignored crops for lane features (#2622) --- .../config/features/garden/laneswitch/FarmingLaneConfig.java | 12 ++++++++++++ .../skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt | 1 + 2 files changed, 13 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/laneswitch/FarmingLaneConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/laneswitch/FarmingLaneConfig.java index 667e32331..bb7ea595b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/laneswitch/FarmingLaneConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/laneswitch/FarmingLaneConfig.java @@ -2,13 +2,18 @@ package at.hannibal2.skyhanni.config.features.garden.laneswitch; import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; +import at.hannibal2.skyhanni.features.garden.CropType; import com.google.gson.annotations.Expose; import io.github.notenoughupdates.moulconfig.annotations.Accordion; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorInfoText; import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import java.util.ArrayList; +import java.util.List; + public class FarmingLaneConfig { @Expose @@ -37,4 +42,11 @@ public class FarmingLaneConfig { @FeatureToggle public boolean cornerWaypoints = false; + @Expose + @ConfigOption( + name = "Ignored Crops", + desc = "Add the crops you wish to not setup a lane for." + ) + @ConfigEditorDraggableList() + public List ignoredCrops = new ArrayList<>(); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt index ba0eaee5d..b9b091e53 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt @@ -43,6 +43,7 @@ object FarmingLaneAPI { private fun warnNoLane(crop: CropType?) { if (crop == null || currentLane != null) return + if (crop in config.ignoredCrops) return if (!GardenAPI.hasFarmingToolInHand()) return if (FarmingLaneCreator.detection) return if (!config.distanceDisplay && !config.laneSwitchNotification.enabled) return -- cgit