6 files changed
+21
-24
No files matched your search
@@ -13,7 +13,6 @@ import org.bukkit.plugin.ServicePriority
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
internal class ChatOG : JavaPlugin() {
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
companion object {
|
||||
val scope = CoroutineScope(Dispatchers.Default + SupervisorJob())
|
||||
|
||||
@@ -31,7 +30,6 @@ internal class ChatOG : JavaPlugin() {
|
||||
fun isLanguageDatabaseInitialized() = ::languageDatabase.isInitialized
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
override fun onEnable() {
|
||||
plugin = this
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package nl.skbotnl.chatog
|
||||
|
||||
import java.util.*
|
||||
import kotlin.concurrent.read
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.launch
|
||||
import net.kyori.adventure.text.Component
|
||||
import net.kyori.adventure.text.JoinConfiguration
|
||||
@@ -16,7 +15,6 @@ import nl.skbotnl.chatog.commands.TranslateMessage
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
internal object ChatSystem {
|
||||
enum class ChatType {
|
||||
GENERAL_CHAT,
|
||||
@@ -41,10 +39,7 @@ internal object ChatSystem {
|
||||
}
|
||||
}
|
||||
|
||||
val messageComponent = ChatUtil.processText(text, player)
|
||||
if (messageComponent == null) {
|
||||
return
|
||||
}
|
||||
val messageComponent = ChatUtil.processText(text, player) ?: return
|
||||
|
||||
val chatComponent =
|
||||
UtilitiesOG.trueogColorize(legacyToMm("$playerPartString<reset>${PlayerAffix.getSuffix(player.uniqueId)}"))
|
||||
@@ -87,10 +82,7 @@ internal object ChatSystem {
|
||||
}
|
||||
}
|
||||
|
||||
val messageComponent = ChatUtil.processText(text, player)
|
||||
if (messageComponent == null) {
|
||||
return
|
||||
}
|
||||
val messageComponent = ChatUtil.processText(text, player) ?: return
|
||||
|
||||
val chatComponent =
|
||||
UtilitiesOG.trueogColorize(legacyToMm("$playerPartString<reset>${PlayerAffix.getSuffix(player.uniqueId)}"))
|
||||
@@ -133,10 +125,7 @@ internal object ChatSystem {
|
||||
}
|
||||
}
|
||||
|
||||
val messageComponent = ChatUtil.processText(text, player)
|
||||
if (messageComponent == null) {
|
||||
return
|
||||
}
|
||||
val messageComponent = ChatUtil.processText(text, player) ?: return
|
||||
|
||||
val chatComponent =
|
||||
UtilitiesOG.trueogColorize(legacyToMm("$playerPartString<reset>${PlayerAffix.getSuffix(player.uniqueId)}"))
|
||||
|
||||
@@ -341,7 +341,7 @@ internal class DiscordBridge private constructor() {
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
config.channelId -> {
|
||||
Component.join(
|
||||
JoinConfiguration.noSeparators(),
|
||||
discordComponent,
|
||||
@@ -350,6 +350,10 @@ internal class DiscordBridge private constructor() {
|
||||
contentComponent,
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
throw RuntimeException("Invalid channel id")
|
||||
}
|
||||
}
|
||||
|
||||
messageComponent =
|
||||
@@ -383,11 +387,23 @@ internal class DiscordBridge private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
config.developerChannelId -> {
|
||||
for (p in Bukkit.getOnlinePlayers()) {
|
||||
if (p.hasPermission("chat-og.developer")) {
|
||||
p.sendMessage(messageComponent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config.channelId -> {
|
||||
for (p in Bukkit.getOnlinePlayers()) {
|
||||
p.sendMessage(messageComponent)
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
throw RuntimeException("Invalid channel id")
|
||||
}
|
||||
}
|
||||
|
||||
TranslateMessage.customMessages[randomUUID] =
|
||||
|
||||
@@ -4,7 +4,6 @@ import io.papermc.paper.advancement.AdvancementDisplay.Frame.*
|
||||
import io.papermc.paper.event.player.AsyncChatEvent
|
||||
import java.util.*
|
||||
import kotlin.concurrent.read
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.launch
|
||||
import me.clip.placeholderapi.PlaceholderAPI
|
||||
import net.ess3.api.events.VanishStatusChangeEvent
|
||||
@@ -31,7 +30,6 @@ import org.bukkit.event.player.*
|
||||
import org.bukkit.event.server.BroadcastMessageEvent
|
||||
import xyz.jpenilla.announcerplus.listener.JoinQuitListener
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
internal class Events : Listener {
|
||||
@EventHandler
|
||||
fun onJoin(event: PlayerJoinEvent) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package nl.skbotnl.chatog.commands
|
||||
|
||||
import java.util.*
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import me.clip.placeholderapi.PlaceholderAPI
|
||||
import net.kyori.adventure.text.Component
|
||||
import net.kyori.adventure.text.JoinConfiguration
|
||||
@@ -40,7 +39,6 @@ internal class TranslateMessage : CommandExecutor {
|
||||
val pmMessages: MutableMap<UUID, SentPMMessage> = HashMap()
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>?): Boolean {
|
||||
if (sender !is Player) {
|
||||
return false
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package nl.skbotnl.chatog.commands
|
||||
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import net.trueog.utilitiesog.UtilitiesOG
|
||||
import nl.skbotnl.chatog.ChatOG
|
||||
import nl.skbotnl.chatog.ChatOG.Companion.config
|
||||
@@ -59,7 +58,6 @@ internal class TranslateSettings : CommandExecutor {
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>?): Boolean {
|
||||
if (sender !is Player) {
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user