diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 17 |
1 files changed, 17 insertions, 0 deletions
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 "" } |
