Skip to content

Commit

Permalink
Merge branch 'hannibal002:beta' into item-stack-size-combat
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx authored Jan 16, 2024
2 parents 31b0f20 + 7245a6a commit 8e85ef5
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 10 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,15 @@
#### Chat Changes

+ Hide new Fire Sale message format. - Thunderblade73
+ Added Hypixel Lobby chat messages "SMP" and "Snow Particles" to the Spam Filter. - walker
+ Added more messages to Hypixel Lobby spam hider.
+ SMP and Snow Particles. - walker
+ Earned mystery dust. - alexia

#### Misc Changes

+ Tia Relay Helper: Suggest /togglemusic. - alexia
+ Added option to ignore Everything Chroma in the chat. - VixidDev

### Fixes

Expand All @@ -110,6 +115,7 @@
+ Fixed Daily Kuudra part of Crimson Isle Reputation Helper not detecting completed runs. - hannibal2
+ Fixed wrong calculation when zero bosses killed in slayer profit trackers. - hannibal2
+ Hide No Fishing Bait warning during Kuudra fight. - hannibal2
+ Fixed Dungeon and Kuudra party finder join message not detecting in party member tab complete. - CalMWolfs

#### Mining Fixes

Expand All @@ -132,6 +138,7 @@
+ Fixed hide non-clickable items not working in some bazaar pages. - hannibal2
+ 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

#### Bingo Fixes

Expand All @@ -146,6 +153,12 @@
#### GUI Fixes

+ Fixed items in SkyHanni GUI elements rendering over minecraft menus. - Thunderblade73
+ Fixed GUI Editor hotkey working while inside a NEU PV text box. - Thunderblade73

#### Winter Fixes

+ Fixed Unique Gifting Opportunities working with Golden Gift. - CalMWolfs
+ Fixed Frozen Treasure Tracker showing wrong Compact Procs number. - CalMWolfs

#### Misc Fixes

Expand Down Expand Up @@ -174,6 +187,10 @@
+ Tell people how to name a pattern variable. - CalMWolfs
+ Typo fixes in contributing md. - CalMWolfs
+ Make Repo Pattern keys more consistent for Farming Gear. - CalMWolfs
+ Added options to ban specific imports in some packages. - nea
+ Don't allow uppercase Repo Pattern keys and added a more descriptive error. - CalMWolfs
+ Moved party API chat messages to Repo Pattern. - CalMWolfs
+ Allowing nullable parameters for regex functions matches() and find(). - hannibal2

## Version 0.22

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

group = "at.hannibal2.skyhanni"
version = "0.23.Beta.7"
version = "0.23.Beta.8"

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 @@ -368,7 +368,7 @@ import org.apache.logging.log4j.Logger
clientSideOnly = true,
useMetadata = true,
guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop",
version = "0.23.Beta.7",
version = "0.23.Beta.8",
)
class SkyHanniMod {
@Mod.EventHandler
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzKeyPressEvent
import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.getPropertiesWithType
import at.hannibal2.skyhanni.utils.LorenzUtils.isRancherSign
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
Expand All @@ -33,7 +35,7 @@ class GuiEditManager {
if (isInGui()) return

Minecraft.getMinecraft().currentScreen?.let {
if (it !is GuiInventory && it !is GuiChest && it !is GuiEditSign && it !is GuiProfileViewer) return
if (it !is GuiInventory && it !is GuiChest && it !is GuiEditSign && !(it is GuiProfileViewer && !it.anyTextBoxFocused())) return
if (it is GuiEditSign && !it.isRancherSign()) return
}

Expand All @@ -51,6 +53,7 @@ class GuiEditManager {
}

companion object {

var currentPositions = mutableMapOf<String, Position>()
private var latestPositions = mapOf<String, Position>()
private var currentBorderSize = mutableMapOf<String, Pair<Int, Int>>()
Expand All @@ -77,8 +80,8 @@ class GuiEditManager {
lastHotkeyReminded = SimpleTimeMark.now()
LorenzUtils.chat(
"§eTo edit hidden GUI elements:\n" +
" §7- §e1. Set a key in /sh edit.\n" +
" §7- §e2. Click that key while the GUI element is visible."
" §7- §e1. Set a key in /sh edit.\n" +
" §7- §e2. Click that key while the GUI element is visible."
)
}
}
Expand Down Expand Up @@ -111,6 +114,9 @@ class GuiEditManager {
fun Position.getAbsX() = getAbsX0(getDummySize(true).x)

fun Position.getAbsY() = getAbsY0(getDummySize(true).y)

fun GuiProfileViewer.anyTextBoxFocused() =
this.getPropertiesWithType<GuiElementTextField>().any{it.focus}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ object FrozenTreasureTracker {
addAsSingletonList("§6${formatNumber(data.treasuresMined)} Treasures Mined")
addAsSingletonList("§3${formatNumber(estimatedIce)} Total Ice")
addAsSingletonList("§3${formatNumber(icePerHour)} Ice/hr")
addAsSingletonList("§8${formatNumber(data.treasuresMined)} Compact Procs")
addAsSingletonList("§8${formatNumber(data.compactProcs)} Compact Procs")
addAsSingletonList("")

for (treasure in FrozenTreasure.entries) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object ShiftClickNPCSell {
@SubscribeEvent
fun onOpen(event: InventoryFullyOpenedEvent) {
if (!LorenzUtils.inSkyBlock) return
inInventory = lastLoreLineOfSellPattern.matches(event.inventoryItems[sellSlot]?.getLore()?.lastOrNull() ?: "")
inInventory = lastLoreLineOfSellPattern.matches(event.inventoryItems[sellSlot]?.getLore()?.lastOrNull())
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class MinionFeatures {
if (!minionTitlePattern.find(event.inventoryName)) return

event.inventoryItems[48]?.let {
if (minionCollectItemPattern.matches(it.name ?: "")) {
if (minionCollectItemPattern.matches(it.name)) {
MinionOpenEvent(event.inventoryName, event.inventoryItems).postAndCatch()
return
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KMutableProperty1
import kotlin.reflect.KProperty
import kotlin.reflect.KProperty0
import kotlin.reflect.KProperty1
import kotlin.reflect.full.isSubtypeOf
import kotlin.reflect.full.memberProperties
import kotlin.reflect.full.starProjectedType
import kotlin.reflect.jvm.isAccessible
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds

Expand Down Expand Up @@ -508,6 +513,14 @@ object LorenzUtils {
}
}

inline fun <reified T : Any> Any.getPropertiesWithType() =
this::class.memberProperties
.filter { it.returnType.isSubtypeOf(T::class.starProjectedType) }
.map {
it.isAccessible = true
(it as KProperty1<Any, T>).get(this)
}

fun List<String>.nextAfter(after: String, skip: Int = 1) = nextAfter({ it == after }, skip)

fun List<String>.nextAfter(after: (String) -> Boolean, skip: Int = 1): String? {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ object StringUtils {

fun String.convertToFormatted(): String = this.replace("&&", "§")

fun Pattern.matches(string: String) = matcher(string).matches()
fun Pattern.matches(string: String?) = string?.let { matcher(it).matches() } ?: false

fun Pattern.find(string: String) = matcher(string).find()
fun Pattern.find(string: String?) = string?.let { matcher(it).find() } ?: false

fun String.allLettersFirstUppercase() = split("_").joinToString(" ") { it.firstLetterUppercase() }

Expand Down

0 comments on commit 8e85ef5

Please sign in to comment.