From 9352ace3e97c92645b176f88b6cef6e638121b95 Mon Sep 17 00:00:00 2001 From: Jordan <77755681+Jordyrat@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:21:14 +0100 Subject: Improvement: Powder Tracker revamped (#2394) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/api') 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() { -- cgit