diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java | 15 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 17 |
2 files changed, 25 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java index 290492705..175dcb42d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java @@ -89,13 +89,14 @@ public class Inventory { ) @ConfigEditorDraggableList( exampleText = { - "\u00a7bMaster Star Tier", - "\u00a7bMaster Skull Tier", - "\u00a7bDungeon Head Floor Number", - "\u00a7bNew Year Cake", - "\u00a7bPet Level", - "\u00a7bMinion Tier", - "\u00a7bCrimson Armor", + "§bMaster Star Tier", + "§bMaster Skull Tier", + "§bDungeon Head Floor Number", + "§bNew Year Cake", + "§bPet Level", + "§bMinion Tier", + "§bCrimson Armor", + "§bWishing Compass" } ) public List<Integer> itemNumberAsStackSize = new ArrayList<>(Collections.singletonList(3)); 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 bc1d310cc..4e25e3c83 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -10,9 +10,12 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.regex.Pattern class ItemDisplayOverlayFeatures { + private val wishingCompassPattern = Pattern.compile("§7Remaining Uses: §e(.*)§8/§e3") + @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { event.stackTip = getStackTip(event.stack) @@ -83,6 +86,20 @@ class ItemDisplayOverlayFeatures { } } + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(7)) { + if (name.contains("Wishing Compass")) { + for (line in item.getLore()) { + val matcher = wishingCompassPattern.matcher(line) + if (matcher.matches()) { + val uses = matcher.group(1) + if (uses != "3") { + return uses + } + } + } + } + } + return "" } |