forked from hannibal002/SkyHanni
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef235ed
commit 6ec0c38
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionOutbidWarning.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package at.hannibal2.skyhanni.features.inventory | ||
|
||
import at.hannibal2.skyhanni.SkyHanniMod | ||
import at.hannibal2.skyhanni.data.TitleManager | ||
import at.hannibal2.skyhanni.events.LorenzChatEvent | ||
import at.hannibal2.skyhanni.utils.LorenzUtils | ||
import at.hannibal2.skyhanni.utils.SoundUtils | ||
import at.hannibal2.skyhanni.utils.StringUtils.matches | ||
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent | ||
import kotlin.time.Duration.Companion.seconds | ||
|
||
object AuctionOutbidWarning { | ||
private val outbidPattern by RepoPattern.pattern( | ||
"auction.outbid", | ||
"§6\\[Auction].*§eoutbid you by.*§e§lCLICK" | ||
) | ||
|
||
@SubscribeEvent | ||
fun onChat(event: LorenzChatEvent) { | ||
if (!LorenzUtils.inSkyBlock) return | ||
if (!SkyHanniMod.feature.inventory.auctions.auctionOutbid) return | ||
if (!outbidPattern.matches(event.message)) return | ||
|
||
TitleManager.sendTitle("§cYou have been outbid!", 5.seconds, 3.6, 7.0f) | ||
SoundUtils.playBeepSound() | ||
} | ||
} |