aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt
diff options
context:
space:
mode:
authorJordan <77755681+Jordyrat@users.noreply.github.com>2024-09-08 08:21:14 +0100
committerGitHub <noreply@github.com>2024-09-08 09:21:14 +0200
commit9352ace3e97c92645b176f88b6cef6e638121b95 (patch)
tree803cbb085fc1b9e4877a8e16c6db697d10e6d90b /src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt
parent5ac091a11d558717eb42106bcad35d23653dab5d (diff)
downloadskyhanni-9352ace3e97c92645b176f88b6cef6e638121b95.tar.gz
skyhanni-9352ace3e97c92645b176f88b6cef6e638121b95.tar.bz2
skyhanni-9352ace3e97c92645b176f88b6cef6e638121b95.zip
Improvement: Powder Tracker revamped (#2394)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt
index 39305a012..97e041a89 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt
@@ -2,12 +2,14 @@ package at.hannibal2.skyhanni.api
import at.hannibal2.skyhanni.data.HotmData
import at.hannibal2.skyhanni.data.ProfileStorageData
+import at.hannibal2.skyhanni.events.mining.PowderGainEvent
+import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemCategory
import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
+import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getDrillUpgrades
-import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase
import at.hannibal2.skyhanni.utils.TimeLimitedCache
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.item.ItemStack
@@ -30,7 +32,7 @@ object HotmAPI {
}
} == true
- enum class Powder(val displayName: String, val color: String) {
+ enum class PowderType(val displayName: String, val color: String) {
MITHRIL("Mithril", "§2"),
GEMSTONE("Gemstone", "§d"),
GLACITE("Glacite", "§b"),
@@ -71,9 +73,11 @@ object HotmAPI {
}
/** Use when new powder gets collected*/
- fun gain(value: Long) {
- addTotal(value)
- addCurrent(value)
+ fun gain(difference: Long) {
+ ChatUtils.debug("Gained §a${difference.addSeparators()} §e${displayName} Powder")
+ addTotal(difference)
+ addCurrent(difference)
+ PowderGainEvent(this, difference).post()
}
fun reset() {