aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authormartimavocado <39881008+martimavocado@users.noreply.github.com>2024-10-01 22:05:00 +0100
committerGitHub <noreply@github.com>2024-10-01 23:05:00 +0200
commitb10fc13cfc7bf9dd191219f5f93337125907a6dd (patch)
treefb062e9e39be517a043b6f043c14779c5257a39b /src/main/java
parente304c8fb4e9d60421b8b679ea99cb93cc6177019 (diff)
downloadskyhanni-b10fc13cfc7bf9dd191219f5f93337125907a6dd.tar.gz
skyhanni-b10fc13cfc7bf9dd191219f5f93337125907a6dd.tar.bz2
skyhanni-b10fc13cfc7bf9dd191219f5f93337125907a6dd.zip
Improvement: Add ignored crops for lane features (#2622)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/laneswitch/FarmingLaneConfig.java12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt1
2 files changed, 13 insertions, 0 deletions
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<CropType> 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