Skip to content

Commit

Permalink
feat: 🎸 日本語化のデフォルト設定を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSheep2804 committed Jul 13, 2023
1 parent 069b3d3 commit f1df210
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ data class SeleneChatConfigData(
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 Japanize by default.")
var japanizeDefault: Boolean = true,
@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
@@ -1,6 +1,7 @@
package io.github.bluesheep2804.selenechat.player

import io.github.bluesheep2804.selenechat.SeleneChat
import io.github.bluesheep2804.selenechat.SeleneChat.config
import net.kyori.adventure.key.Key
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.event.HoverEvent
Expand All @@ -13,7 +14,13 @@ abstract class SeleneChatPlayer {
abstract val currentServerName: String
open val isOnline = true
val isEnabledJapanize: Boolean
get() = SeleneChat.japanizePlayers.enable.contains(uniqueId.toString())
get() {
return if (!SeleneChat.japanizePlayers.enable.contains(uniqueId.toString()) && !SeleneChat.japanizePlayers.disable.contains(uniqueId.toString())) {
config.japanizeDefault
} else {
SeleneChat.japanizePlayers.enable.contains(uniqueId.toString())
}
}
abstract fun sendMessage(msg: Component)
open fun asHoverEvent(): HoverEvent<out Examinable> {
return HoverEvent.showEntity(HoverEvent.ShowEntity.of(Key.key("player"), uniqueId, Component.text(displayName)))
Expand Down

0 comments on commit f1df210

Please sign in to comment.