From 1ae2d5722480c3f6ca8dd7a6c86233245fe30a09 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 15 Apr 2023 14:58:33 +0200 Subject: code cleanup --- src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt index c9bf25047..21c35837c 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt @@ -7,8 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name -import io.github.moulberry.notenoughupdates.util.stripControlCodes -import net.minecraftforge.event.world.WorldEvent +import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenCropUpgrades { @@ -29,7 +28,7 @@ class GardenCropUpgrades { fun onInventoryOpen(event: InventoryOpenEvent) { if (event.inventoryName != "Crop Upgrades") return event.inventoryItems.forEach { (_, item) -> - val crop = item.name?.stripControlCodes()?.let { + val crop = item.name?.removeColor()?.let { CropType.getByName(it) } ?: return@forEach val level = item.getLore().firstNotNullOfOrNull { -- cgit