From 29a21538cfd6f7cf4e0ba52e0d69137213909e8b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 12 Dec 2023 02:07:50 +0100 Subject: Fixed error message with newly bought fungi cutter. --- .../skyhanni/features/garden/farming/WrongFungiCutterWarning.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') 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) } -- cgit