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 | |
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')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Garden.java | 2 | ||||
-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 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index f84e875f0..9d1a21042 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -266,7 +266,7 @@ class SkyHanniMod { loadModule(GardenOptimalSpeed()) loadModule(GardenDeskInSBMenu()) loadModule(GardenLevelDisplay()) - loadModule(EliteFarmingWeight()) + loadModule(FarmingWeightDisplay()) loadModule(DicerRngDropCounter()) loadModule(CropMoneyDisplay) loadModule(JacobFarmingContestsInventory()) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index ad39b0254..0afc5d2fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -727,7 +727,7 @@ public class Garden { public Position gardenLevelPos = new Position(-375, -215, false, true); @Expose - @ConfigOption(name = "Elite Farming Weight", desc = "") + @ConfigOption(name = "Farming Weight", desc = "") @ConfigEditorAccordion(id = 11) public boolean eliteFarmingWeight = false; 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()) { |