summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt78
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt58
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt61
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerBossSpawnSoon.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt15
23 files changed, 183 insertions, 186 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
index 8f28038fa..0b0a444d9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
@@ -11,9 +11,9 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.PurseChangeCause
import at.hannibal2.skyhanni.events.PurseChangeEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.events.TabListUpdateEvent
import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData.Option
import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData.Option.KILLS
@@ -44,7 +44,8 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble
+import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal
import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision
import at.hannibal2.skyhanni.utils.OSUtils
@@ -103,7 +104,7 @@ object GhostCounter {
private var skillText = ""
private var lastParsedSkillSection = ""
private var lastSkillProgressString: String? = null
- private var lastXp: String = "0"
+ private var lastXp: Long = 0
private var gain: Int = 0
private var num: Double = 0.0
private var inMist = false
@@ -292,41 +293,42 @@ object GhostCounter {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- skillXPPattern.matchMatcher(skillText) {
- val gained = group("gained").formatNumber().toDouble()
- val current = group("current")
- if (current != lastXp) {
- val res = current.formatNumber().toString()
- gain = (res.toLong() - lastXp.toLong()).toDouble().roundToInt()
- num = (gain.toDouble() / gained)
- if (gained in 150.0..450.0 && lastXp != "0" && num >= 0) {
- KILLS.add(num)
- KILLS.add(num, true)
- Option.GHOSTSINCESORROW.add(num)
- Option.KILLCOMBO.add(num)
- Option.SKILLXPGAINED.add(gained * num.roundToLong())
- Option.SKILLXPGAINED.add(gained * num.roundToLong(), true)
- storage?.bestiaryCurrentKill = storage?.bestiaryCurrentKill?.plus(num) ?: num
- }
- lastXp = res
+
+ skillXPPattern.matchMatcher(skillText) {
+ val gained = group("gained").formatDouble()
+ val current = group("current").formatLong()
+ if (current != lastXp) {
+ gain = (current - lastXp).toDouble().roundToInt()
+ num = (gain.toDouble() / gained)
+ if (gained in 150.0..450.0 && lastXp != 0L && num >= 0) {
+ KILLS.add(num)
+ KILLS.add(num, true)
+ Option.GHOSTSINCESORROW.add(num)
+ Option.KILLCOMBO.add(num)
+ Option.SKILLXPGAINED.add(gained * num.roundToLong())
+ Option.SKILLXPGAINED.add(gained * num.roundToLong(), true)
+ storage?.bestiaryCurrentKill = storage?.bestiaryCurrentKill?.plus(num) ?: num
}
+ lastXp = current
}
- if (notifyCTModule && ProfileStorageData.profileSpecific?.ghostCounter?.ctDataImported != true) {
- notifyCTModule = false
- if (isUsingCTGhostCounter()) {
- clickableChat(
- "GhostCounterV3 ChatTriggers module has been detected, do you want to import saved data ? Click here to import data",
- "shimportghostcounterdata",
- prefixColor = "§6",
- )
- }
+ }
+
+ if (notifyCTModule && ProfileStorageData.profileSpecific?.ghostCounter?.ctDataImported != true) {
+ notifyCTModule = false
+ if (isUsingCTGhostCounter()) {
+ clickableChat(
+ "GhostCounterV3 ChatTriggers module has been detected, do you want to import saved data ? Click here to import data",
+ "shimportghostcounterdata",
+ prefixColor = "§6",
+ )
}
- inMist = LorenzUtils.skyBlockArea == "The Mist"
- update()
}
+
+ inMist = LorenzUtils.skyBlockArea == "The Mist"
+ update()
+
if (event.repeatSeconds(2)) {
calculateXP()
calculateETA()
@@ -436,10 +438,10 @@ object GhostCounter {
}
killComboExpiredPattern.matchMatcher(event.message) {
if (Option.KILLCOMBO.getInt() > Option.MAXKILLCOMBO.getInt()) {
- Option.MAXKILLCOMBO.set(group("combo").formatNumber().toDouble())
+ Option.MAXKILLCOMBO.set(group("combo").formatDouble())
}
if (Option.KILLCOMBO.getInt() > Option.MAXKILLCOMBO.getInt(true)) {
- Option.MAXKILLCOMBO.set(group("combo").formatNumber().toDouble(), true)
+ Option.MAXKILLCOMBO.set(group("combo").formatDouble(), true)
}
Option.KILLCOMBOCOINS.set(0.0)
Option.KILLCOMBO.set(0.0)
@@ -490,11 +492,11 @@ object GhostCounter {
for (line in ghostStack.getLore()) {
val l = line.removeColor().trim()
if (l.startsWith("Kills: ")) {
- kills = "Kills: (.*)".toRegex().find(l)?.groupValues?.get(1)?.formatNumber()?.toDouble() ?: 0.0
+ kills = "Kills: (.*)".toRegex().find(l)?.groupValues?.get(1)?.formatDouble() ?: 0.0
}
ghostXPPattern.matchMatcher(line.removeColor().trim()) {
- storage?.bestiaryCurrentKill = if (kills > 0) kills else group("current").formatNumber().toDouble()
- storage?.bestiaryKillNeeded = group("total").formatNumber().toDouble()
+ storage?.bestiaryCurrentKill = if (kills > 0) kills else group("current").formatDouble()
+ storage?.bestiaryKillNeeded = group("total").formatDouble()
}
}
update()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt
index a39c59274..bff80b930 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt
@@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.events.MessageSendToServerEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
-import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment
+import at.hannibal2.skyhanni.utils.ItemUtils.itemName
import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
@@ -68,7 +68,7 @@ object WikiManager {
private fun wikiTheItem(item: ItemStack, autoOpen: Boolean, useFandom: Boolean = config.useFandom) {
val itemDisplayName =
- (item.nameWithEnchantment ?: return).replace("§a✔ ", "").replace("§c✖ ", "")
+ item.itemName.replace("§a✔ ", "").replace("§c✖ ", "")
val internalName = item.getInternalName().asString()
val wikiUrlSearch = if (internalName != "NONE") internalName else itemDisplayName.removeColor()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt
index 47f742ded..cf893fd0d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt
@@ -16,7 +16,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.equalsOneOf
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.StringUtils.matchFirst
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
@@ -203,7 +203,7 @@ object DungeonAPI {
val lore = inventoryItems[4]?.getLore() ?: return
val line = lore.find { it.contains("Total Kills:") } ?: return
val kills = totalKillsPattern.matchMatcher(line) {
- group("kills").formatNumber().toInt()
+ group("kills").formatInt()
} ?: return
bossCollections[floor] = kills
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
index 7724d4c5d..25b20b08a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
@@ -12,7 +12,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.matches
@@ -117,8 +117,7 @@ object DianaProfitTracker {
}
chatDugOutCoinsPattern.matchMatcher(message) {
BurrowAPI.lastBurrowRelatedChatMessage = SimpleTimeMark.now()
- val coins = group("coins").formatNumber().toInt()
- tracker.addCoins(coins)
+ tracker.addCoins(group("coins").formatInt())
tryHide(event)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
index 4fb025097..96baef5a3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
@@ -28,6 +28,7 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
+import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine
import at.hannibal2.skyhanni.utils.RenderUtils.drawColor
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
@@ -208,7 +209,8 @@ object GriffinBurrowHelper {
event.drawColor(location, LorenzColor.LIGHT_PURPLE)
val distance = location.distance(playerLocation)
if (distance > 10) {
- val formattedDistance = LorenzUtils.formatInteger(distance.toInt())
+ // TODO use round(1)
+ val formattedDistance = distance.toInt().addSeparators()
event.drawDynamicText(location.add(y = 1), "§d§lInquisitor §e${formattedDistance}m", 1.7)
} else {
event.drawDynamicText(location.add(y = 1), "§d§lInquisitor", 1.7)
@@ -270,7 +272,7 @@ object GriffinBurrowHelper {
val color = if (currentWarp != null && targetLocation == guessLocation) "§b" else "§f"
event.drawDynamicText(guessLocation.add(y = 1), "${color}Guess", 1.5)
if (distance > 5) {
- val formattedDistance = LorenzUtils.formatInteger(distance.toInt())
+ val formattedDistance = distance.toInt().addSeparators()
event.drawDynamicText(guessLocation.add(y = 1), "§e${formattedDistance}m", 1.7, yOff = 10f)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt
index dc6246abe..f13ea5824 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt
@@ -19,7 +19,7 @@ import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.StringUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
@@ -192,8 +192,7 @@ object FishingProfitTracker {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
coinsChatPattern.matchMatcher(event.message) {
- val coins = group("coins").formatNumber()
- tracker.addCoins(coins.toInt())
+ tracker.addCoins(group("coins").formatInt())
addCatch()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt
index dcafc6603..5409062f5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt
@@ -7,7 +7,8 @@ import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager.getFillet
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NEUItems
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
+import at.hannibal2.skyhanni.utils.NEUItems.getPrice
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -27,7 +28,8 @@ class TrophyFishFillet {
val rarity = TrophyRarity.getByName(trophyRarityName) ?: return
val multiplier = if (Keyboard.KEY_LSHIFT.isKeyHeld()) event.itemStack.stackSize else 1
val filletValue = info.getFilletValue(rarity) * multiplier
- val filletPrice = filletValue * NEUItems.getPrice("MAGMA_FISH")
+ // TODO use magma fish member
+ val filletPrice = filletValue * "MAGMA_FISH".asInternalName().getPrice()
event.toolTip.add("§7Fillet: §8${filletValue.addSeparators()} Magmafish §7(§6${NumberUtil.format(filletPrice)}§7)")
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index 171aa503d..0d0494bf9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -44,7 +44,6 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
-import at.hannibal2.skyhanni.utils.TimeUtils
import at.hannibal2.skyhanni.utils.TimeUtils.format
import at.hannibal2.skyhanni.utils.renderables.Renderable
import net.minecraftforge.fml.common.eventhandler.EventPriority
@@ -54,7 +53,6 @@ import kotlin.math.ceil
import kotlin.math.floor
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds
-import kotlin.time.DurationUnit
object ComposterOverlay {
@@ -320,20 +318,20 @@ object ComposterOverlay {
list.add(fuelItem.getItemStack())
newList.add(list)
- val timePerCompost = ComposterAPI.timePerCompost(null).toLong(DurationUnit.MILLISECONDS)
+ val timePerCompost = ComposterAPI.timePerCompost(null)
val upgrade = if (maxLevel) null else extraComposterUpgrade
- val timePerCompostPreview = ComposterAPI.timePerCompost(upgrade).toLong(DurationUnit.MILLISECONDS)
- val format = TimeUtils.formatDuration(timePerCompost)
+ val timePerCompostPreview = ComposterAPI.timePerCompost(upgrade)
+ val format = timePerCompost.format()
val formatPreview =
- if (timePerCompostPreview != timePerCompost) " §c➜ §b" + TimeUtils.formatDuration(timePerCompostPreview) else ""
+ if (timePerCompostPreview != timePerCompost) " §c➜ §b" + timePerCompostPreview.format() else ""
newList.addAsSingletonList(" §7Time per Compost: §b$format$formatPreview")
val timeText = currentTimeType.display.lowercase()
val timeMultiplier = if (currentTimeType != TimeType.COMPOST) {
- (currentTimeType.multiplier * 1000 / (timePerCompost.toDouble()))
+ (currentTimeType.multiplier * 1000.0 / (timePerCompost.inWholeMilliseconds))
} else 1.0
val timeMultiplierPreview = if (currentTimeType != TimeType.COMPOST) {
- (currentTimeType.multiplier * 1000 / (timePerCompostPreview.toDouble()))
+ (currentTimeType.multiplier * 1000.0 / (timePerCompostPreview.inWholeMilliseconds))
} else 1.0
val multiDropFactor = ComposterAPI.multiDropChance(null) + 1
@@ -491,8 +489,7 @@ object ComposterOverlay {
return
}
- val havingInSacks = internalName.getAmountInSacksOrNull()
- if (havingInSacks == null) {
+ val havingInSacks = internalName.getAmountInSacksOrNull() ?: run {
ChatUtils.sendCommandToServer("gfs ${internalName.asString()} ${itemsNeeded - havingInInventory}")
// TODO Add sack type repo data
@@ -504,7 +501,8 @@ object ComposterOverlay {
"sax"
)
return
- } else if (havingInSacks == 0L) {
+ }
+ if (havingInSacks == 0) {
SoundUtils.playErrorSound()
if (LorenzUtils.noTradeMode) {
ChatUtils.chat("No $itemName §efound in sacks.")
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 eec532ed1..112fce914 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
@@ -25,6 +25,7 @@ import at.hannibal2.skyhanni.utils.ConditionalUtils
import at.hannibal2.skyhanni.utils.ConfigUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.round
+import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.TimeUnit
@@ -162,11 +163,11 @@ object GardenCropMilestoneDisplay {
}
lineMap[2] = if (crop.isMaxed()) {
- val haveFormat = LorenzUtils.formatInteger(counter)
+ val haveFormat = counter.addSeparators()
Collections.singletonList("§7Counter: §e$haveFormat")
} else {
- val haveFormat = LorenzUtils.formatInteger(have)
- val needFormat = LorenzUtils.formatInteger(need)
+ val haveFormat = have.addSeparators()
+ val needFormat = need.addSeparators()
Collections.singletonList("§e$haveFormat§8/§e$needFormat")
}
@@ -194,7 +195,7 @@ object GardenCropMilestoneDisplay {
}
}
- val format = LorenzUtils.formatInteger(farmingFortuneSpeed * 60)
+ val format = (farmingFortuneSpeed * 60).addSeparators()
lineMap[4] = Collections.singletonList("§7Crops/Minute§8: §e$format")
val formatBps = LorenzUtils.formatDouble(speed, config.blocksBrokenPrecision)
lineMap[5] = Collections.singletonList("§7Blocks/Second§8: §e$formatBps")
@@ -266,8 +267,8 @@ object GardenCropMilestoneDisplay {
val have = counter - cropsForCurrentTier
val need = cropsForNextTier - cropsForCurrentTier
- val haveFormat = LorenzUtils.formatInteger(have)
- val needFormat = LorenzUtils.formatInteger(need)
+ val haveFormat = have.addSeparators()
+ val needFormat = need.addSeparators()
val missing = need - have
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt
index e503dfc82..43b0c37d3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt
@@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide
data class FortuneUpgrade(
val description: String,
val costCopper: Int?,
+ //todo make into NEUInternalName
val requiredItem: String,
val itemQuantity: Int,
val fortuneIncrease: Double,
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt
index 2d33fd9b1..5abc89f80 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt
@@ -14,7 +14,8 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.g
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrCommon
import at.hannibal2.skyhanni.utils.ItemUtils.itemName
-import at.hannibal2.skyhanni.utils.NEUItems
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
+import at.hannibal2.skyhanni.utils.NEUItems.getPrice
import at.hannibal2.skyhanni.utils.NumberUtil.addSuffix
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount
@@ -63,7 +64,7 @@ object FortuneUpgrades {
// todo fix NEU price data not being loaded if run too early
private fun MutableList<FortuneUpgrade>.populateAndSort(style: Int) {
this.map { upgrade ->
- val cost = (NEUItems.getPrice(upgrade.requiredItem) * (upgrade.itemQuantity)).toInt()
+ val cost = (upgrade.requiredItem.asInternalName().getPrice() * upgrade.itemQuantity).toInt()
upgrade.cost = cost
upgrade.costPerFF = (cost / upgrade.fortuneIncrease).toInt()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt
index 5818566eb..e8134a337 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt
@@ -4,8 +4,9 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI
import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneUpgrades
import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi
import at.hannibal2.skyhanni.utils.GuiRenderUtils
-import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment
-import at.hannibal2.skyhanni.utils.NEUItems
+import at.hannibal2.skyhanni.utils.ItemUtils.itemName
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
+import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.NumberUtil
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.util.MathHelper
@@ -56,8 +57,8 @@ class UpgradePage : FFGuideGUI.FFGuidePage() {
for ((index, upgrade) in upgradeList.withIndex()) {
if (adjustedY + 25 * index < FFGuideGUI.guiTop + 20) continue
if (adjustedY + 25 * index > FFGuideGUI.guiTop + 160) continue
- val upgradeItem = upgrade.requiredItem.let { NEUItems.getItemStack(it) }
- var formattedUpgrade = upgradeItem.nameWithEnchantment ?: return
+ val upgradeItem = upgrade.requiredItem.asInternalName().getItemStack()
+ var formattedUpgrade = upgradeItem.itemName
if (adjustedY + 25 * index - 5 < FFGuideGUI.lastClickedHeight && FFGuideGUI.lastClickedHeight < adjustedY + 25 * index + 10) {
FFGuideGUI.lastClickedHeight = 0
BazaarApi.searchForBazaarItem(formattedUpgrade, upgrade.itemQuantity)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
index 6639f42da..2031a2ff1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
@@ -20,7 +20,7 @@ import at.hannibal2.skyhanni.utils.ConfigUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -107,33 +107,33 @@ object GardenVisitorDropStatistics {
val storage = GardenAPI.storage?.visitorDrops ?: return
copperPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
+ val amount = group("amount").formatInt()
storage.copper += amount
saveAndUpdate()
}
farmingExpPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber()
+ val amount = group("amount").formatInt()
storage.farmingExp += amount
saveAndUpdate()
}
gardenExpPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
+ val amount = group("amount").formatInt()
if (amount > 80) return // some of the low visitor milestones will get through but will be minimal
storage.gardenExp += amount
saveAndUpdate()
}
bitsPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
+ val amount = group("amount").formatInt()
storage.bits += amount
saveAndUpdate()
}
mithrilPowderPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
+ val amount = group("amount").formatInt()
storage.mithrilPowder += amount
saveAndUpdate()
}
gemstonePowderPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
+ val amount = group("amount").formatInt()
storage.gemstonePowder += amount
saveAndUpdate()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt
index 9118db86e..2b25db259 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt
@@ -23,7 +23,6 @@ import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.renderables.Renderable
@@ -70,15 +69,15 @@ object SackDisplay {
val sackItems = SackAPI.sackItem.toList()
if (sackItems.isNotEmpty()) {
val sortedPairs: MutableMap<String, SackAPI.SackOtherItem> = when (config.sortingType) {
- SortingTypeEntry.DESC_STORED -> sackItems.sortedByDescending { it.second.stored.formatNumber() }
- SortingTypeEntry.ASC_STORED -> sackItems.sortedBy { it.second.stored.formatNumber() }
+ SortingTypeEntry.DESC_STORED -> sackItems.sortedByDescending { it.second.stored }
+ SortingTypeEntry.ASC_STORED -> sackItems.sortedBy { it.second.stored }
SortingTypeEntry.DESC_PRICE -> sackItems.sortedByDescending { it.second.price }
SortingTypeEntry.ASC_PRICE -> sackItems.sortedBy { it.second.price }
- else -> sackItems.sortedByDescending { it.second.stored.formatNumber() }
+ else -> sackItems.sortedByDescending { it.second.stored }
}.toMap().toMutableMap()
sortedPairs.toList().forEach { (k, v) ->
- if (v.stored == "0" && !config.showEmpty) {
+ if (v.stored == 0 && !config.showEmpty) {
sortedPairs.remove(k)
}
}
@@ -90,7 +89,7 @@ objec