aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-12 02:07:50 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-12 02:07:50 +0100
commit29a21538cfd6f7cf4e0ba52e0d69137213909e8b (patch)
tree987ed6dcb51fa18dcfc1b5d997b99e1f8df91fff /src/main/java/at/hannibal2/skyhanni/features
parent6cfe7aa0f56878c4729ca6e2479170e05260fae6 (diff)
downloadskyhanni-29a21538cfd6f7cf4e0ba52e0d69137213909e8b.tar.gz
skyhanni-29a21538cfd6f7cf4e0ba52e0d69137213909e8b.tar.bz2
skyhanni-29a21538cfd6f7cf4e0ba52e0d69137213909e8b.zip
Fixed error message with newly bought fungi cutter.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt
index dc31789a9..bea0d4b92 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt
@@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.events.GardenToolChangeEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.garden.CropType
import at.hannibal2.skyhanni.features.garden.GardenAPI
-import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFungiCutterMode
import at.hannibal2.skyhanni.utils.SoundUtils
@@ -63,7 +62,8 @@ class WrongFungiCutterWarning {
}
private fun readItem(item: ItemStack) {
- val rawMode = item.getFungiCutterMode() ?: error("Tool without fungi cutter mode: '${item.name}'")
+ // The fungi cutter mode is not set into the item nbt data immediately after purchasing it.
+ val rawMode = item.getFungiCutterMode() ?: return
mode = FungiMode.getOrNull(rawMode)
}