Skip to content

Commit

Permalink
Merge branch 'beta' of https://github.com/hannibal002/SkyHanni into i…
Browse files Browse the repository at this point in the history
…tem-stack-size-sbleveling
  • Loading branch information
RayDeeUx committed Jan 29, 2024
2 parents a8ad8ef + 51fc65a commit 5007042
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/data/RenderData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,7 +56,7 @@ class TitleManager {
endTime = SimpleTimeMark.farPast()
}

@SubscribeEvent(priority = EventPriority.LOWEST)
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (endTime.isInPast()) return

Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ object FishingProfitTracker {
tracker.resetCommand(args, "shresetfishingtracker")
}

fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled
fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && !LorenzUtils.inKuudraFight
}
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<HideNotClickableItemsJson>("HideNotClickableItems")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -472,6 +473,7 @@ object EstimatedItemValueCalculator {
}

private fun addRune(stack: ItemStack, list: MutableList<String>): Double {
if (stack.getInternalName().isRune()) return 0.0
val internalName = stack.getRune() ?: return 0.0

val price = internalName.getPrice()
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,6 @@ object ItemUtils {
}
return rarity
}

fun NEUInternalName.isRune(): Boolean = contains("_RUNE;")
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 5007042

Please sign in to comment.