Skip to content

Commit

Permalink
feat: 🎸 δΈ€ζ™‚ηš„γ«ζ—₯本θͺžεŒ–γ‚’η„‘εŠΉεŒ–γ§γγ‚‹γ‚ˆγ†γ«
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSheep2804 committed Jul 11, 2023
1 parent b14fd9f commit 9e42abf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ data class SeleneChatConfigData(

@YamlComment("Specifying the chat conversion mode.", "Possible values: none, hiragana, ime")
var convertMode: ConvertMode = ConvertMode.IME,
@YamlComment("Set a marker to indicate that you do not want to Japanize temporarily.")
var nonJapanizeMarker: String = "$",
@YamlComment("Whether to send message content to proxy servers using plugin messages.", "Applies to Spigot only.")
var shouldSendPluginMessage: Boolean = false,
@YamlComment("Choose whether to send the message in the standard Minecraft message format or in SeleneChat's own format.", "If true, SeleneChat's format will be used.", "Applies to Spigot only.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ object ChatMessage {
fun message(msg: String): Component {
val mm = MiniMessage.miniMessage()
val serializedMessage = if (config.useColorCode) {
LegacyComponentSerializer.legacyAmpersand().deserialize(msg)
LegacyComponentSerializer.legacyAmpersand().deserialize(msg.removePrefix("$"))
} else {
Component.text(msg)
Component.text(msg.removePrefix("$"))
}
val japaneseConversion = Japanizer(PlainTextComponentSerializer.plainText().serialize(serializedMessage))
val messageTagResolver = Placeholder.component(
Expand All @@ -38,7 +38,7 @@ object ChatMessage {
)
val jpTagResolver = TagResolver.resolver("jp")
{ args: ArgumentQueue, _: Context ->
if (config.convertMode == ConvertMode.NONE || !japaneseConversion.shouldConvert()) {
if (config.convertMode == ConvertMode.NONE || !japaneseConversion.shouldConvert() || msg[0] == '$') {
return@resolver Tag.selfClosingInserting(Component.text(""))
}
val prefix = args.popOr("prefix").value()
Expand Down

0 comments on commit 9e42abf

Please sign in to comment.