aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt18
2 files changed, 21 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java
index 7a19fc368..f411bebb7 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java
@@ -77,6 +77,11 @@ public class InventoryConfig {
public List<Integer> itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 11, 12, 14));
@Expose
+ @ConfigOption(name = " Vacuum Bag Cap", desc = "Capping the Garden Vacuum Bag item number display to 40.")
+ @ConfigEditorBoolean
+ public boolean vacuumBagCap = true;
+
+ @Expose
@ConfigOption(
name = "Quick Craft Confirmation",
desc = "Require Ctrl+Click to craft items that aren't often quick crafted " +
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
index 57b3ec36c..e7d6490be 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
@@ -21,6 +21,8 @@ import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class ItemDisplayOverlayFeatures {
+ private val config get() = SkyHanniMod.feature.inventory
+
private val rancherBootsSpeedCapPattern = "§7Current Speed Cap: §a(?<cap>.*)".toPattern()
private val petLevelPattern = "\\[Lvl (?<level>.*)] .*".toPattern()
@@ -41,7 +43,7 @@ class ItemDisplayOverlayFeatures {
private fun getStackTip(item: ItemStack): String {
val itemName = item.cleanName()
- val itemNumberAsStackSize = SkyHanniMod.feature.inventory.itemNumberAsStackSize
+ val itemNumberAsStackSize = config.itemNumberAsStackSize
if (itemNumberAsStackSize.contains(0)) {
when (itemName) {
"First Master Star" -> return "1"
@@ -183,7 +185,19 @@ class ItemDisplayOverlayFeatures {
for (line in item.getLore()) {
gardenVacuumPatterm.matchMatcher(line) {
val pests = group("amount").formatNumber()
- return if (pests > 39) "§640" else "$pests"
+ return if (config.vacuumBagCap) {
+ if (pests > 39) "§640" else "$pests"
+ } else {
+ if (pests < 40) {
+ "$pests"
+ } else if (pests < 1_000) {
+ "§6$pests"
+ } else if (pests < 100_000) {
+ "§c${pests / 1000}k"
+ } else {
+ "§c${pests / 100_000 / 10.0}m"
+ }
+ }
}
}
}