diff --git a/CHANGELOG.md b/CHANGELOG.md index cf00521dbd09..adfdaf1598d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,7 @@ + Added toggle to count double hook catches as two catches in Sea Creature Tracker. - hannibal2 + Smarter check if the player is fishing for all fishing related displays. - hannibal2 + Hide Sea Creature Tracker when wearing full Trophy Hunter armor. - martimavocado ++ Disabled Fishing Profit/SC Tracker in Kuudra. - CalMWolfs #### Mining Changes @@ -120,6 +121,8 @@ + Added option to hide pet candy count on maxed out pets. - CalMWolfs + Added option to change the size of the Pet Item Display Icon in inventories. - Thunderblade73 + Allow putting Water Bottles into Potion Bag. - alexia ++ Skip unavailable experiments for number of clicks in Super Pair Clicks Alert in the experimentation table. - alexia ++ Hide non-clickable items in Basket of Seeds, Nether Wart Pouch & Trick or Treat Bag. - alexia #### Dungeon Changes @@ -214,6 +217,8 @@ + Fixed rogue sword ability taking into account mage cooldown reduction. - Empa + Reset item ability cooldowns on the world switch. - hannibal2 + Fixed Crap Hat of Celebration not getting detected as accessory in Hide Not Clickable Items. - Empa ++ Fixed rune price calculation in Chest Value. - hannibal2 ++ Fixed Power Stone Guide Highlight shows in other inventories when exiting via command. - hannibal2 #### Bingo Fixes @@ -229,6 +234,7 @@ + Fixed items in SkyHanni GUI elements rendering over minecraft menus. - Thunderblade73 + Fixed GUI Editor hotkey working while inside a NEU PV text box. - Thunderblade73 ++ Fixed render overlapping problem with chat, SkyHanni GUIs and title. - Thunderblade73 #### Winter Fixes @@ -243,6 +249,7 @@ + Fixed Daily City Project Reminder is still working on already-released projects. - alexia + Fixed a typo in Odger Waypoint config. - Empa + Fixed NPC typos in config. - absterge ++ Fixed rare error in Harp Features. - Thunderblade73 ### Technical Changes diff --git a/build.gradle.kts b/build.gradle.kts index 8a1912cd7275..a5b6af8fb7c1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { } group = "at.hannibal2.skyhanni" -version = "0.23.Beta.14" +version = "0.23.Beta.15" val gitHash by lazy { val baos = ByteArrayOutputStream() diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 1289732ac32d..378be2332f75 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -377,7 +377,7 @@ import org.apache.logging.log4j.Logger clientSideOnly = true, useMetadata = true, guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop", - version = "0.23.Beta.14", + version = "0.23.Beta.15", ) class SkyHanniMod { diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt index 3050889494f5..917ea9f5d2e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt @@ -24,7 +24,9 @@ class RenderData { if (!SkyHanniDebugsAndTests.globalRender) return if (GuiEditManager.isInGui() || VisualWordGui.isInGui()) return + GlStateManager.translate(0f,0f,-3f) GuiRenderEvent.GuiOverlayRenderEvent().postAndCatch() + GlStateManager.translate(0f,0f,3f) } @SubscribeEvent @@ -38,7 +40,9 @@ class RenderData { GlStateManager.enableDepth() if (GuiEditManager.isInGui()) { + GlStateManager.translate(0f,0f,-3f) GuiRenderEvent.GuiOverlayRenderEvent().postAndCatch() + GlStateManager.translate(0f,0f,3f) } GuiRenderEvent.ChestGuiOverlayRenderEvent().postAndCatch() diff --git a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt index 275a6f9f7e77..6dd0c672591a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt @@ -8,7 +8,6 @@ import io.github.moulberry.moulconfig.internal.TextRenderUtils import net.minecraft.client.Minecraft import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager -import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds @@ -57,7 +56,7 @@ class TitleManager { endTime = SimpleTimeMark.farPast() } - @SubscribeEvent(priority = EventPriority.LOWEST) + @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (endTime.isInPast()) return @@ -70,7 +69,7 @@ class TitleManager { val renderer = Minecraft.getMinecraft().fontRendererObj GlStateManager.pushMatrix() - GlStateManager.translate((width / 2).toFloat(), (height / heightModifier).toFloat(), 0.0f) + GlStateManager.translate((width / 2).toFloat(), (height / heightModifier).toFloat(), 3.0f) GlStateManager.scale(fontSizeModifier, fontSizeModifier, fontSizeModifier) TextRenderUtils.drawStringCenteredScaledMaxWidth(display, renderer, 0f, 0f, true, 75, 0) GlStateManager.popMatrix() diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt index ca6ef6f3d16d..5a92ae51a716 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt @@ -211,5 +211,5 @@ object FishingProfitTracker { tracker.resetCommand(args, "shresetfishingtracker") } - fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled + fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && !LorenzUtils.inKuudraFight } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt index eb0fe4a510e2..8bfcadde7efd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt @@ -165,7 +165,7 @@ object SeaCreatureTracker { tracker.resetCommand(args, "shresetseacreaturetracker") } - private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && !isTrophyFishing + private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && !isTrophyFishing && !LorenzUtils.inKuudraFight private fun isWearingTrophyArmor(): Boolean = InventoryUtils.getArmor().all { trophyArmorNames.matches(it?.getInternalName()?.asString()) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index 5e6656b3bc67..645e20510cce 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -158,7 +158,7 @@ object HarpFeatures { if (!isMenuGui(InventoryUtils.openInventoryName())) return if (event.slot?.slotNumber != closeButtonSlot) return if (openTime.passedSince() > 2.seconds) return - event.container.inventory.indexOfFirst { + event.container.inventory.filterNotNull().indexOfFirst { songSelectedPattern.anyMatches(it.getLore()) }.takeIf { it != -1 }?.let { event.isCanceled = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index ac9c402e786f..4088a4264c9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -26,9 +26,12 @@ import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.equalsOneOf import at.hannibal2.skyhanni.utils.MultiFilter +import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRiftExportable import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRiftTransferable +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest @@ -52,6 +55,13 @@ class HideNotClickableItems { private val hidePlayerTradeFilter = MultiFilter() private val notAuctionableFilter = MultiFilter() + private val seedsPattern by RepoPattern.pattern( + "inventory.hidenotclickable.seeds", + "SEEDS|CARROT_ITEM|POTATO_ITEM|PUMPKIN_SEEDS|SUGAR_CANE|MELON_SEEDS|CACTUS|INK_SACK-3" + ) + + private val netherWart by lazy { "NETHER_STALK".asInternalName() } + @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { val hideNotClickable = event.getConstant("HideNotClickableItems") @@ -176,6 +186,9 @@ class HideNotClickableItems { hidePlayerTrade(chestName, stack) -> true hideBazaarOrAH(chestName, stack) -> true hideAccessoryBag(chestName, stack) -> true + hideBasketOfSeeds(chestName, stack) -> true + hideNetherWartPouch(chestName, stack) -> true + hideTrickOrTreatBag(chestName, stack) -> true hideSackOfSacks(chestName, stack) -> true hideFishingBag(chestName, stack) -> true hidePotionBag(chestName, stack) -> true @@ -347,6 +360,50 @@ class HideNotClickableItems { return true } + private fun hideBasketOfSeeds(chestName: String, stack: ItemStack): Boolean { + if (!chestName.startsWith("Basket of Seeds")) return false + + if (ItemUtils.isSkyBlockMenuItem(stack)) { + hideReason = "The SkyBlock Menu cannot be put into the basket of seeds!" + return true + } + + seedsPattern.matchMatcher(stack.getInternalName().asString()) { + return false + } + + hideReason = "This item is not a seed!" + return true + } + + private fun hideNetherWartPouch(chestName: String, stack: ItemStack): Boolean { + if (!chestName.startsWith("Nether Wart Pouch")) return false + + if (ItemUtils.isSkyBlockMenuItem(stack)) { + hideReason = "The SkyBlock Menu cannot be put into the nether wart pouch!" + return true + } + + if (stack.getInternalName() == netherWart) return false + + hideReason = "This item is not a nether wart!" + return true + } + + private fun hideTrickOrTreatBag(chestName: String, stack: ItemStack): Boolean { + if (!chestName.startsWith("Trick or Treat Bag")) return false + + if (ItemUtils.isSkyBlockMenuItem(stack)) { + hideReason = "The SkyBlock Menu cannot be put into the trick or treat bag!" + return true + } + + if (stack.cleanName() == "Green Candy" || stack.cleanName() == "Purple Candy") return false + + hideReason = "This item is not a spooky candy!" + return true + } + private fun hidePlayerTrade(chestName: String, stack: ItemStack): Boolean { if (!chestName.startsWith("You ")) return false diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt index 24972cde587a..e9545355e404 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt @@ -44,6 +44,11 @@ class PowerStoneGuideFeatures { inInventory = false } + @SubscribeEvent + fun onInventoryClose(event: GuiContainerEvent.CloseWindowEvent) { + inInventory = false + } + @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt index 6ca018c9f8e7..e2519fd721a1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/SuperpairsClicksAlert.kt @@ -29,6 +29,7 @@ class SuperpairsClicksAlert { roundsNeeded = -1 break } + if (lore.any { it.contains("Enchanting level too low!") || it.contains("Not enough experience!") }) continue val match = lore.asReversed().firstNotNullOfOrNull { roundsNeededRegex.find(it.removeColor()) } ?: continue roundsNeeded = match.groups[1]!!.value.toInt() break diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index d3560d3c6107..527dfe4fecdd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.RenderItemTooltipEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.isRune import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils @@ -182,7 +183,7 @@ object EstimatedItemValue { // Blocks the dungeon map if (internalName.startsWith("MAP-")) return listOf() // Hides the rune item - if (internalName.contains("_RUNE;")) return listOf() + if (internalName.isRune()) return listOf() if (internalName.contains("UNIQUE_RUNE")) return listOf() if (internalName.contains("WISP_POTION")) return listOf() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt index 6014130658ce..2ff799e77eae 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getItemName import at.hannibal2.skyhanni.utils.ItemUtils.getItemNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.isRune import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzRarity @@ -472,6 +473,7 @@ object EstimatedItemValueCalculator { } private fun addRune(stack: ItemStack, list: MutableList): Double { + if (stack.getInternalName().isRune()) return 0.0 val internalName = stack.getRune() ?: return 0.0 val price = internalName.getPrice() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 3bc79dbf29f5..d2c9776b717e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -380,4 +380,6 @@ object ItemUtils { } return rarity } + + fun NEUInternalName.isRune(): Boolean = contains("_RUNE;") } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt index 01f9941aa7c6..142fd81658e2 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -8,7 +8,6 @@ import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper import io.github.moulberry.notenoughupdates.util.Utils import net.minecraft.client.Minecraft import net.minecraft.client.gui.Gui -import net.minecraft.client.gui.GuiChat import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.client.renderer.GlStateManager import net.minecraft.item.ItemStack @@ -233,8 +232,6 @@ interface Renderable { override fun render(posX: Int, posY: Int) { GlStateManager.pushMatrix() - if (Minecraft.getMinecraft().currentScreen is GuiChat) - GlStateManager.translate(0F, 0F, -3F) any.renderOnScreen(0F, 0F, scaleMultiplier = scale) GlStateManager.popMatrix() }