aboutsummaryrefslogtreecommitdiff
path: root/src/main
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
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')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt6
2 files changed, 8 insertions, 0 deletions
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 e37f3ecae..1af9cbca1 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
@@ -227,6 +227,7 @@ public class Garden {
"§7In §b12m 34s",
"§7Crops/Minute§8: §e12,345",
"§7Blocks/Second§8: §e20",
+ "§7Percentage: §e12.34%",
}
)
@ConfigAccordionId(id = 6)
@@ -315,6 +316,7 @@ public class Garden {
"§7Mushroom Tier 8",
"§e6,700§8/§e15,000",
"§7In §b12m 34s",
+ "§7Percentage: §e12.34%",
}
)
@ConfigAccordionId(id = 15)
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 {