diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-10 13:01:53 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-10 13:01:53 +0200 |
commit | a009b1082453841aa0784233fc158e82aba50fed (patch) | |
tree | c03f5aef34652486abea3136114974f0ada0313a | |
parent | 7f6f565eb6ff49f0bd99278e85377a2792c4a706 (diff) | |
download | skyhanni-a009b1082453841aa0784233fc158e82aba50fed.tar.gz skyhanni-a009b1082453841aa0784233fc158e82aba50fed.tar.bz2 skyhanni-a009b1082453841aa0784233fc158e82aba50fed.zip |
Fixed ComposterOverlay crash with invalid item selected
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 0cd611e2d..018ffe73b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -142,9 +142,26 @@ class ComposterOverlay { private fun update() { if (organicMatterFactors.isEmpty()) { organicMatterDisplay = - Collections.singletonList(listOf("§cSkyHanni composter error:", "§cRepo data not loaded!")) + Collections.singletonList( + listOf( + "§cSkyHanni composter error:", "§cRepo data not loaded!", + "§7(organicMatterFactors is empty)" + ) + ) return } + if (fuelFactors.isEmpty()) { + organicMatterDisplay = + Collections.singletonList( + listOf( + "§cSkyHanni composter error:", "§cRepo data not loaded!", + "§7(fuelFactors is empty)" + ) + ) + return + } + if (currentOrganicMatterItem.let { it !in organicMatterFactors && it != "" }) currentOrganicMatterItem = "" + if (currentFuelItem.let { it !in organicMatterFactors && it != "" }) currentFuelItem = "" if (inComposter) { organicMatterDisplay = drawOrganicMatterDisplay() |