Skip to content

Commit

Permalink
migrate PartyAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs committed Jan 1, 2024
1 parent 128480b commit 4f27f56
Showing 1 changed file with 50 additions and 14 deletions.
64 changes: 50 additions & 14 deletions src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,60 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.StringUtils.removeResets
import at.hannibal2.skyhanni.utils.StringUtils.trimWhiteSpaceAndResets
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.random.Random

object PartyAPI {
// TODO USE SH-REPO
private val youJoinedPartyPattern = "§eYou have joined (?<name>.*)'s §eparty!".toPattern()
private val othersJoinedPartyPattern = "(?<name>.*) §ejoined the party.".toPattern()
private val othersInThePartyPattern = "§eYou'll be partying with: (?<names>.*)".toPattern()
private val otherLeftPattern = "(?<name>.*) §ehas left the party.".toPattern()
private val otherKickedPattern = "(?<name>.*) §ehas been removed from the party.".toPattern()
private val otherOfflineKickedPattern = "§eKicked (?<name>.*) because they were offline.".toPattern()
private val otherDisconnectedPattern =
"(?<name>.*) §ewas removed from your party because they disconnected.".toPattern()
private val transferPattern = "The party was transferred to .* because (?<name>.*) left".toPattern()
private val disbandedPattern = ".* §ehas disbanded the party!".toPattern()
private val kickedPattern = "§eYou have been kicked from the party by .* §e".toPattern()
private val partyMembersStartPattern = "§6Party Members \\(\\d+\\)".toPattern()
private val partyMemberListPattern = "Party (?:Leader|Moderators|Members): (?<names>.*)".toPattern()
private val youJoinedPartyPattern by RepoPattern.pattern(
"data.party.you.joined",
"§eYou have joined (?<name>.*)'s §eparty!"
)
private val othersJoinedPartyPattern by RepoPattern.pattern(
"data.party.others.joined",
"(?<name>.*) §ejoined the party\\."
)
private val othersInThePartyPattern by RepoPattern.pattern(
"data.party.others.inparty",
"§eYou'll be partying with: (?<names>.*)"
)
private val otherLeftPattern by RepoPattern.pattern(
"data.party.others.left",
"(?<name>.*) §ehas left the party\\."
)
private val otherKickedPattern by RepoPattern.pattern(
"data.party.others.kicked",
"(?<name>.*) §ehas been removed from the party\\."
)
private val otherOfflineKickedPattern by RepoPattern.pattern(
"data.party.others.offline",
"§eKicked (?<name>.*) because they were offline\\."
)
private val otherDisconnectedPattern by RepoPattern.pattern(
"data.party.others.disconnect",
"(?<name>.*) §ewas removed from your party because they disconnected\\."
)
private val transferPattern by RepoPattern.pattern(
"data.party.others.transfer",
"The party was transferred to .* because (?<name>.*) left"
)
private val disbandedPattern by RepoPattern.pattern(
"data.party.others.disband",
".* §ehas disbanded the party!"
)
private val kickedPattern by RepoPattern.pattern(
"data.party.you.kicked",
"§eYou have been kicked from the party by .* §e"
)
private val partyMembersStartPattern by RepoPattern.pattern(
"data.party.members.start",
"§6Party Members \\(\\d+\\)"
)

private val partyMemberListPattern by RepoPattern.pattern(
"data.party.members.list",
"Party (?:Leader|Moderators|Members): (?<names>.*)"
)

val partyMembers = mutableListOf<String>()

Expand Down

0 comments on commit 4f27f56

Please sign in to comment.