aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-17 22:48:24 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-17 22:48:24 +0200
commit924c691f3d21cd33519298d36aa0e29bff02bfe6 (patch)
tree79db52e96d32871ef824222bc00539b341e99660 /src/main/java/at/hannibal2/skyhanni/features
parent6e0c30ab39b7836e0614e167b4c1dcf705bb6e7e (diff)
downloadskyhanni-924c691f3d21cd33519298d36aa0e29bff02bfe6.tar.gz
skyhanni-924c691f3d21cd33519298d36aa0e29bff02bfe6.tar.bz2
skyhanni-924c691f3d21cd33519298d36aa0e29bff02bfe6.zip
Added percentages to crop milestone display and mushroom perk display (default disabled)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt6
1 files changed, 6 insertions, 0 deletions
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 0442e4ffe..7145c77d2 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
@@ -312,6 +312,9 @@ class GardenCropMilestoneDisplay {
lineMap[5] = Collections.singletonList("§7Blocks/Second§8: §e$lastBlocksPerSecond")
}
+ val percentageFormat = LorenzUtils.formatPercentage(have.toDouble() / need.toDouble())
+ lineMap[6] = Collections.singletonList("§7Percentage: §e$percentageFormat")
+
if (GardenAPI.mushroomCowPet && crop != CropType.MUSHROOM) {
if (mushroom_cow_nether_warts && crop == CropType.NETHER_WART) {
mushroomCowPerkDisplay = listOf(
@@ -377,6 +380,9 @@ class GardenCropMilestoneDisplay {
lineMap[2] = Collections.singletonList("§e$haveFormat§8/§e$needFormat")
lineMap[3] = Collections.singletonList("§7In §b$duration")
+ val percentageFormat = LorenzUtils.formatPercentage(have.toDouble() / need.toDouble())
+ lineMap[4] = Collections.singletonList("§7Percentage: §e$percentageFormat")
+
val newList = mutableListOf<List<Any>>()
for (index in config.cropMilestoneMushroomPetPerkText) {
lineMap[index]?.let {