diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-08 16:21:41 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-08 16:21:41 +0100 |
commit | d56e3075c7d418e0004f072703e635e83e2a06cf (patch) | |
tree | f695e11d12de721964766b98640ced72a1430e82 /src/main/java/at/hannibal2/skyhanni/features | |
parent | f277a99f2c547c446b8c5e0ddfa3021062e3cf40 (diff) | |
download | skyhanni-d56e3075c7d418e0004f072703e635e83e2a06cf.tar.gz skyhanni-d56e3075c7d418e0004f072703e635e83e2a06cf.tar.bz2 skyhanni-d56e3075c7d418e0004f072703e635e83e2a06cf.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt index 41ef944ea..05abfe744 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt @@ -40,6 +40,8 @@ enum class CropType( val multiplier by lazy { if (this == SUGAR_CANE || this == CACTUS) 2 else 1 } + override fun toString(): String = cropName + companion object { fun getByNameOrNull(itemName: String): CropType? { if (itemName == "Red Mushroom" || itemName == "Brown Mushroom") return MUSHROOM diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index e6f59fe88..d5d1881e2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -421,12 +421,7 @@ object GardenNextJacobContest { ) } - private fun warnForCrop(): Boolean { - for(crop in nextContestCrops) { - if (config.warnFor.contains(crop.ordinal)) return true - } - return false - } + private fun warnForCrop(): Boolean = nextContestCrops.any { it in config.warnFor } @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { |