Skip to content

Commit

Permalink
Revert messageColor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Dec 5, 2023
1 parent 5f5edbc commit 6691398
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import com.mineinabyss.chatty.components.ChannelType
import com.mineinabyss.chatty.components.SpyOnChannels
import com.mineinabyss.chatty.queries.SpyingPlayers
import com.mineinabyss.geary.papermc.tracking.entities.toGeary
import com.mineinabyss.idofront.serialization.ColorSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.kyori.adventure.audience.Audience
import net.kyori.adventure.text.format.NamedTextColor
import net.kyori.adventure.text.format.TextColor
import org.bukkit.Bukkit
import org.bukkit.Color
import org.bukkit.entity.Player

@Serializable
Expand All @@ -25,14 +23,14 @@ data class ChattyChannel(
val isDefaultChannel: Boolean = false,
val isStaffChannel: Boolean = false,
val format: String = "",
@Serializable(with=ColorSerializer::class)
@SerialName("messageColor") val _messageColor: Color = Color.WHITE,
@SerialName("messageColor") val _messageColor: String = "white",
val channelRadius: Int = 0,
val channelAliases: List<String> = listOf(),
) {
val key by lazy { chatty.config.channels.entries.first { it.value == this }.key }
val messageColor: TextColor
get() = TextColor.color(_messageColor.asRGB())
get() = TextColor.fromHexString(_messageColor) ?: NamedTextColor.NAMES.value(_messageColor)
?: NamedTextColor.WHITE


fun getAudience(player: Player): Collection<Audience> {
Expand Down

0 comments on commit 6691398

Please sign in to comment.