diff options
Diffstat (limited to 'src')
4 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt index fa8003ca5..99407b3ed 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt @@ -45,6 +45,7 @@ enum class ItemCategory { COSMETIC, MEMENTO, PORTAL, + SACK, NONE, ; diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 0f506bacc..e44cccd9a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -256,6 +256,7 @@ object ItemUtils { isPet(cleanName) -> ItemCategory.PET UtilsPatterns.enchantedBookPattern.matches(name) -> ItemCategory.ENCHANTED_BOOK UtilsPatterns.potionPattern.matches(name) -> ItemCategory.POTION + UtilsPatterns.sackPattern.matches(name) -> ItemCategory.SACK else -> ItemCategory.NONE } else { LorenzUtils.enumValueOfOrNull<ItemCategory>(itemCategory) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index d33fead7f..eafcc3fef 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.mixins.transformers.AccessorGuiEditSign import at.hannibal2.skyhanni.test.TestBingo import at.hannibal2.skyhanni.utils.ChatUtils.lastButtonClicked import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc +import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.StringUtils.capAtMinecraftLength @@ -271,13 +272,15 @@ object LorenzUtils { fun IslandType.isInIsland() = inSkyBlock && skyBlockIsland == this - fun GuiContainerEvent.SlotClickEvent.makeShiftClick() = + fun GuiContainerEvent.SlotClickEvent.makeShiftClick() { + if (this.clickedButton == 1 && slot?.stack?.getItemCategoryOrNull() == ItemCategory.SACK) return slot?.slotNumber?.let { slotNumber -> Minecraft.getMinecraft().playerController.windowClick( container.windowId, slotNumber, 0, 1, Minecraft.getMinecraft().thePlayer ) isCanceled = true } + } private val recalculateDerpy = RecalculatingValue(1.seconds) { MayorElection.isPerkActive("Derpy", "DOUBLE MOBS HP!!!") } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt b/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt index 014a1ad54..8f4d78239 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt @@ -46,6 +46,11 @@ object UtilsPatterns { "(?:§f§f)?§7\\[Lvl (?<level>\\d+)] .*" ) + val sackPattern by patternGroup.pattern( + "item.sack", + ".*Sack" + ) + val seasonPattern by patternGroup.pattern( "skyblocktime.season", "(?:Early |Late )?(?<season>Spring|Summer|Autumn|Winter)" |