Skip to content

Commit

Permalink
fix: first emoteid instance handling all, including with/withour argu…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
Boy0000 committed Dec 19, 2023
1 parent c8b89d0 commit 731f013
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/kotlin/com/mineinabyss/emojy/EmojyHelpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private fun Component.escapeEmoteIDs(player: Player): Component {

msg = msg.replaceText(
TextReplacementConfig.builder()
.match(emote.baseRegex.pattern)
.matchLiteral(match.value)
.replacement("\\${match.value}".miniMsg())
.build()
)
Expand All @@ -51,7 +51,7 @@ private fun Component.escapeEmoteIDs(player: Player): Component {
if (gif.checkPermission(player)) return@forEach
msg = msg.replaceText(
TextReplacementConfig.builder()
.match(gif.baseRegex.pattern)
.matchLiteral(match.value)
.replacement("\\${match.value}".miniMsg())
.build()
)
Expand All @@ -63,7 +63,7 @@ private fun Component.escapeEmoteIDs(player: Player): Component {

msg = msg.replaceText(
TextReplacementConfig.builder()
.match(spaceRegex.pattern)
.matchLiteral(match.value)
.replacement("\\:space_$space:".miniMsg())
.build()
)
Expand All @@ -88,7 +88,7 @@ private fun Component.transformEmoteIDs(insert: Boolean = true, isUtf: Boolean):

msg = msg.replaceText(
TextReplacementConfig.builder()
.match(emote.baseRegex.pattern)
.matchLiteral(match.value)
.replacement(emote.formattedUnicode(insert = false, colorable = colorable, bitmapIndex = bitmapIndex))
.build()
)
Expand All @@ -97,7 +97,7 @@ private fun Component.transformEmoteIDs(insert: Boolean = true, isUtf: Boolean):
if (isUtf) emote.escapedRegex.findAll(serialized).forEach { match ->
msg = msg.replaceText(
TextReplacementConfig.builder()
.match(emote.escapedRegex.pattern)
.matchLiteral(match.value)
.replacement(match.value.removePrefix("\\"))
.build()
)
Expand Down

0 comments on commit 731f013

Please sign in to comment.