Skip to content

Commit a08fc86

Browse files
chore: preprocess ScamCheck.kt
[no ci]
1 parent fb950fd commit a08fc86

File tree

1 file changed

+11
-2
lines changed
  • mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc

1 file changed

+11
-2
lines changed

mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ScamCheck.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ object ScamCheck : EventSubscriber {
5656
if (!Utils.inSkyblock || !Skytils.config.scamCheck) return
5757
when (val packet = event.packet) {
5858
is S2DPacketOpenWindow -> {
59-
if (tradingRegex.matches(packet.windowTitle.unformattedText)) {
59+
val windowTitle =
60+
//#if MC<12000
61+
packet.windowTitle.formattedText
62+
//#else
63+
//$$ packet.name.string
64+
//#endif
65+
if (tradingRegex.matches(windowTitle)) {
6066
tradingWindowId = packet.windowId
6167
scamChecked = false
6268
}
@@ -83,7 +89,10 @@ object ScamCheck : EventSubscriber {
8389
val firstLore = ItemUtil.getItemLore(tradingWith).find { it.matches(tradingWithRegex) } ?: return
8490
val otherParty = firstLore.replace(tradingWithRegex, "$1")
8591
val worldUUID = mc.theWorld?.playerEntities?.find {
86-
it.uniqueID.version() == 4 && it.name == otherParty
92+
it.uniqueID.version() == 4 && otherParty == it.name
93+
//#if MC>=11600
94+
//$$ .string
95+
//#endif
8796
}?.uniqueID
8897
Skytils.IO.launch {
8998
val uuid = worldUUID ?: runCatching { MojangUtil.getUUIDFromUsername(otherParty) }.getOrNull()

0 commit comments

Comments
 (0)