diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-21 20:58:11 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-21 20:58:11 +0200 |
commit | 7efb8034e57ea845f7464a467e2beff3684d6fe1 (patch) | |
tree | 1bd14539eaf173295faeda4ce95a98cb42905aeb /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | fa1b4237c3bda4c26d58f21f4f59c96fcb1d7066 (diff) | |
download | skyhanni-7efb8034e57ea845f7464a467e2beff3684d6fe1.tar.gz skyhanni-7efb8034e57ea845f7464a467e2beff3684d6fe1.tar.bz2 skyhanni-7efb8034e57ea845f7464a467e2beff3684d6fe1.zip |
Added more error messages to farming weight display
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt) | 12 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index 653724da5..e6c924baa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/EliteFarmingWeight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -20,12 +20,12 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent import java.util.* -class EliteFarmingWeight { +class FarmingWeightDisplay { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (isEnabled()) { - config.eliteFarmingWeightPos.renderStrings(display, posLabel = "Elite Farming Weight") + config.eliteFarmingWeightPos.renderStrings(display, posLabel = "Farming Weight Display") } } @@ -105,9 +105,15 @@ class EliteFarmingWeight { if (weight == -1.0) { if (!isLoadingWeight) { val localProfile = HypixelData.profileName - if (localProfile == "") return + if (localProfile == "") { + display = Collections.singletonList("§cError: profileName is empty!") + return + } isLoadingWeight = true + if (display.isEmpty()) { + display = Collections.singletonList("§cLoading..") + } SkyHanniMod.coroutineScope.launch { loadWeight(localProfile) isLoadingWeight = false diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index 26064b3ab..c726a11bc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt @@ -104,7 +104,7 @@ object GardenCropMilestoneDisplay { if (cultivatingData.containsKey(crop)) { val old = cultivatingData[crop]!! val addedCounter = (counter - old).toInt() - EliteFarmingWeight.addCrop(crop, addedCounter) + FarmingWeightDisplay.addCrop(crop, addedCounter) update() crop.setCounter( crop.getCounter() + if (GardenCropSpeed.finneganPerkActive()) { |