diff options
author | ILike2WatchMemes <ilike2watchmemes@gmail.com> | 2024-07-21 12:21:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-21 12:21:17 +0200 |
commit | 00831584bfa2e0e54e5f5bc65efbce10e06ee8e9 (patch) | |
tree | 4ff0654dac577151fe3e161744a4aab905d71290 | |
parent | 39f46e73324b2e8ee0d8971e60588afb143f1fdc (diff) | |
download | skyhanni-00831584bfa2e0e54e5f5bc65efbce10e06ee8e9.tar.gz skyhanni-00831584bfa2e0e54e5f5bc65efbce10e06ee8e9.tar.bz2 skyhanni-00831584bfa2e0e54e5f5bc65efbce10e06ee8e9.zip |
Improvement: Added SkyBlock Level to Item Number (#2172)
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 16 |
2 files changed, 17 insertions, 0 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 45c0a9e98..37201d64c 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 @@ -142,6 +142,7 @@ public class InventoryConfig { DARK_CACAO_TRUFFLE("§bDark Cacao Truffle"), EDITION_NUMBER("§bEdition Number", 16), BINGO_GOAL_RANK("§bBingo Goal Rank"), + SKYBLOCK_LEVEL("§bSkyblock Level") ; private final String str; 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 324227248..ebd793cab 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,7 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.PET_LEVEL import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.RANCHERS_BOOTS_SPEED import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKILL_LEVEL +import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKYBLOCK_LEVEL import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.VACUUM_GARDEN import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.events.RenderItemTipEvent @@ -84,6 +85,15 @@ object ItemDisplayOverlayFeatures { "(§.)*You were the (§.)*(?<rank>[\\w]+)(?<ordinal>(st|nd|rd|th)) (§.)*to" ) + /** + * REGEX-TEST: §7Your SkyBlock Level: §8[§a156§8] + * REGEX-TEST: §7Your SkyBlock Level: §8[§5399§8] + */ + private val skyblockLevelPattern by patternGroup.pattern( + "skyblocklevel", + "§7Your SkyBlock Level: §8\\[(?<level>§.\\d+)§8]" + ) + @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { event.stackTip = getStackTip(event.stack) ?: return @@ -267,6 +277,12 @@ object ItemDisplayOverlayFeatures { } } + if (SKYBLOCK_LEVEL.isSelected() && chestName == "SkyBlock Menu" && itemName == "SkyBlock Leveling") { + lore.matchFirst(skyblockLevelPattern) { + return group("level") + } + } + return null } |