diff --git a/gradle.properties b/gradle.properties index 2b3e584e..59fa5cfb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group=me.arasple.mc.trchat -version=2.0.7 -taboolib_version=6.0.12-15 +version=2.0.8 +taboolib_version=6.0.12-26 kotlin.incremental=true kotlin.incremental.java=true koltin.incremental.useClasspathSnapshot=true diff --git a/project/module-nms/build.gradle.kts b/project/module-nms/build.gradle.kts index e216cf77..c3f6fe67 100644 --- a/project/module-nms/build.gradle.kts +++ b/project/module-nms/build.gradle.kts @@ -1,5 +1,6 @@ dependencies { compileOnly(project(":project:common")) + compileOnly("ink.ptms.core:v12002:12002:mapped") compileOnly("ink.ptms.core:v12001:12001:mapped") compileOnly("ink.ptms.core:v11903:11903:mapped") compileOnly("ink.ptms.core:v11902:11902:mapped") diff --git a/project/module-nms/src/main/kotlin/me/arasple/mc/trchat/api/nms/NMSImpl.kt b/project/module-nms/src/main/kotlin/me/arasple/mc/trchat/api/nms/NMSImpl.kt index ba4f2e0a..8c72eb73 100644 --- a/project/module-nms/src/main/kotlin/me/arasple/mc/trchat/api/nms/NMSImpl.kt +++ b/project/module-nms/src/main/kotlin/me/arasple/mc/trchat/api/nms/NMSImpl.kt @@ -11,16 +11,18 @@ import taboolib.module.chat.ComponentText import taboolib.module.nms.MinecraftVersion.isUniversal import taboolib.module.nms.MinecraftVersion.majorLegacy import taboolib.module.nms.sendPacket -import taboolib.platform.util.isNotAir +import taboolib.platform.util.isAir import java.util.* private typealias IChatBaseComponent12 = net.minecraft.server.v1_12_R1.IChatBaseComponent private typealias ChatSerializer12 = net.minecraft.server.v1_12_R1.IChatBaseComponent.ChatSerializer private typealias ChatSerializer16 = net.minecraft.server.v1_16_R1.IChatBaseComponent.ChatSerializer -private typealias CraftPlayer19 = org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer +private typealias CraftPlayer19 = org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer +private typealias CraftItemStack12 = org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack private typealias CraftItemStack19 = org.bukkit.craftbukkit.v1_19_R2.inventory.CraftItemStack private typealias CraftChatMessage19 = org.bukkit.craftbukkit.v1_19_R2.util.CraftChatMessage -private typealias NMSNBTTagCompound = net.minecraft.nbt.NBTTagCompound +private typealias NBTTagCompound12 = net.minecraft.server.v1_12_R1.NBTTagCompound +private typealias NBTTagCompound19 = net.minecraft.nbt.NBTTagCompound private typealias NMSIChatBaseComponent = net.minecraft.network.chat.IChatBaseComponent @Suppress("unused") @@ -77,7 +79,7 @@ class NMSImpl : NMS() { override fun hoverItem(component: ComponentText, itemStack: ItemStack): ComponentText { val nmsItem = CraftItemStack19.asNMSCopy(itemStack) - val nbtTag = NMSNBTTagCompound() + val nbtTag = NBTTagCompound19() nmsItem.save(nbtTag) val id = nbtTag.getString("id") ?: "minecraft:air" val nbt = nbtTag.get("tag")?.toString() ?: "{}" @@ -85,20 +87,34 @@ class NMSImpl : NMS() { } override fun optimizeNBT(itemStack: ItemStack, nbtWhitelist: Array): ItemStack { + if (itemStack.isAir()) return itemStack try { - val nmsItem = CraftItemStack19.asNMSCopy(itemStack) - if (itemStack.isNotAir() && nmsItem.hasTag()) { - if (isUniversal) { - val nbtTag = NMSNBTTagCompound() - nmsItem.tag!!.allKeys.forEach { - if (it in nbtWhitelist) { - nbtTag.put(it, nmsItem.tag!!.get(it)) + if (isUniversal) { + val nmsItem = CraftItemStack19.asNMSCopy(itemStack) + if (nmsItem.hasTag()) { + val nbtTag = NBTTagCompound19() + nmsItem.tag!!.allKeys.forEach { key -> + if (key in nbtWhitelist) { + nbtTag.put(key, nmsItem.tag!!.get(key)) } } nmsItem.tag = nbtTag return CraftItemStack19.asBukkitCopy(nmsItem) } + } else { + val nmsItem = CraftItemStack12.asNMSCopy(itemStack) + if (nmsItem.hasTag()) { + val nbtTag = NBTTagCompound12() + nmsItem.tag!!.c().forEach { key -> + if (key in nbtWhitelist) { + nbtTag.set(key, nmsItem.tag!!.get(key)) + } + } + nmsItem.tag = nbtTag + return CraftItemStack12.asBukkitCopy(nmsItem) + } } + } catch (t: Throwable) { t.reportOnce("Got an error optimizing item nbt") } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/ChatSession.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/ChatSession.kt index 9fa04367..51561f1d 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/ChatSession.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/ChatSession.kt @@ -7,9 +7,9 @@ import me.arasple.mc.trchat.module.display.channel.PrivateChannel import me.arasple.mc.trchat.util.color.CustomColor import me.arasple.mc.trchat.util.color.MessageColors import me.arasple.mc.trchat.util.data -import me.arasple.mc.trchat.util.getDataContainer import me.arasple.mc.trchat.util.reportOnce import org.bukkit.entity.Player +import taboolib.expansion.getDataContainer import taboolib.module.nms.Packet import taboolib.module.nms.sendPacket import java.util.* diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/Channel.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/Channel.kt index a88ac096..2006da79 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/Channel.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/Channel.kt @@ -16,6 +16,7 @@ import org.bukkit.command.CommandSender import org.bukkit.entity.Player import taboolib.common.platform.command.PermissionDefault import taboolib.common.platform.command.command +import taboolib.common.platform.function.adaptPlayer import taboolib.common.platform.function.console import taboolib.common.platform.function.getProxyPlayer import taboolib.common.platform.function.unregisterCommand @@ -125,7 +126,7 @@ open class Channel( player.sendLang("Channel-No-Speak-Permission") return null } - if (settings.filterBeforeSending && TrChat.api().getFilterManager().filter(message).sensitiveWords > 0) { + if (settings.filterBeforeSending && TrChat.api().getFilterManager().filter(message, adaptPlayer(player)).sensitiveWords > 0) { player.sendLang("Channel-Bad-Language") return null } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/PrivateChannel.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/PrivateChannel.kt index 3ee2ddc0..541b6880 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/PrivateChannel.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/display/channel/PrivateChannel.kt @@ -19,6 +19,7 @@ import org.bukkit.entity.Player import taboolib.common.platform.command.PermissionDefault import taboolib.common.platform.command.command import taboolib.common.platform.command.suggest +import taboolib.common.platform.function.adaptPlayer import taboolib.common.platform.function.console import taboolib.common.platform.function.getProxyPlayer import taboolib.common.util.subList @@ -93,7 +94,7 @@ class PrivateChannel( player.sendLang("Channel-No-Speak-Permission") return null } - if (settings.filterBeforeSending && TrChat.api().getFilterManager().filter(message).sensitiveWords > 0) { + if (settings.filterBeforeSending && TrChat.api().getFilterManager().filter(message, adaptPlayer(player)).sensitiveWords > 0) { player.sendLang("Channel-Bad-Language") return null } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/command/main/CommandMute.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/command/main/CommandMute.kt index bbfe8e54..b627e33b 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/command/main/CommandMute.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/command/main/CommandMute.kt @@ -39,37 +39,35 @@ object CommandMute { BukkitProxyManager.getPlayerNames().keys.toList() } execute { sender, ctx, _ -> - val player = Bukkit.getOfflinePlayer(ctx["player"]) - if (!player.hasPlayedBefore()) { - return@execute sender.sendLang("Command-Player-Not-Exist") - } + val player = Bukkit.getPlayer(ctx["player"]) + ?: return@execute sender.sendLang("Command-Player-Not-Exist") val data = player.data data.updateMuteTime("999d".parseMillis()) - sender.sendLang("Mute-Muted-Player", player.name!!, "999d", "null") - (player as? Player)?.sendLang("General-Muted", muteDateFormat.format(data.muteTime), data.muteReason) + sender.sendLang("Mute-Muted-Player", player.name, "999d", "null") + (player as? Player) + ?.sendLang("General-Muted", muteDateFormat.format(data.muteTime), data.muteReason) } dynamic("options", optional = true) { suggestUncheck { listOf("-t 1h", "-t 2d", "-t 15m", "-r Reason", "--cancel") } execute { sender, ctx, argument -> - val player = Bukkit.getOfflinePlayer(ctx["player"]) - if (!player.hasPlayedBefore()) { - return@execute sender.sendLang("Command-Player-Not-Exist") - } + val player = Bukkit.getPlayer(ctx["player"]) + ?: return@execute sender.sendLang("Command-Player-Not-Exist") val data = player.data val de = Demand("mute $argument") if (de.tags.contains("cancel")) { data.updateMuteTime(0) - sender.sendLang("Mute-Cancel-Muted-Player", player.name!!) + sender.sendLang("Mute-Cancel-Muted-Player", player.name) (player as? Player)?.sendLang("General-Cancel-Muted") } else { val time = de.get("t") ?: "999d" val reason = de.get("r") ?: "null" data.updateMuteTime(time.parseMillis()) data.setMuteReason(reason) - sender.sendLang("Mute-Muted-Player", player.name!!, time, reason) - (player as? Player)?.sendLang("General-Muted", muteDateFormat.format(data.muteTime), data.muteReason) + sender.sendLang("Mute-Muted-Player", player.name, time, reason) + (player as? Player) + ?.sendLang("General-Muted", muteDateFormat.format(data.muteTime), data.muteReason) } } } @@ -84,12 +82,10 @@ object CommandMute { BukkitProxyManager.getPlayerNames().keys.toList() } execute { sender, ctx, _ -> - val player = Bukkit.getOfflinePlayer(ctx["player"]) - if (!player.hasPlayedBefore()) { - return@execute sender.sendLang("Command-Player-Not-Exist") - } + val player = Bukkit.getPlayer(ctx["player"]) + ?: return@execute sender.sendLang("Command-Player-Not-Exist") player.data.updateMuteTime(0) - sender.sendLang("Mute-Cancel-Muted-Player", player.name!!) + sender.sendLang("Mute-Cancel-Muted-Player", player.name) (player as? Player)?.sendLang("General-Cancel-Muted") } } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/data/PlayerData.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/data/PlayerData.kt index 95d36d19..1c2f79a7 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/data/PlayerData.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/data/PlayerData.kt @@ -1,12 +1,12 @@ package me.arasple.mc.trchat.module.internal.data import me.arasple.mc.trchat.module.display.channel.Channel -import me.arasple.mc.trchat.util.getDataContainer import me.arasple.mc.trchat.util.parseString import me.arasple.mc.trchat.util.toUUID -import org.bukkit.OfflinePlayer +import org.bukkit.entity.Player import taboolib.common5.cbool import taboolib.common5.clong +import taboolib.expansion.getDataContainer import java.util.* import java.util.concurrent.ConcurrentHashMap @@ -14,11 +14,11 @@ import java.util.concurrent.ConcurrentHashMap * @author ItsFlicker * @since 2022/6/25 18:17 */ -class PlayerData(val player: OfflinePlayer) { +class PlayerData(val player: Player) { init { if (isVanishing) { - vanishing += player.name!! + vanishing += player.name } } @@ -70,7 +70,7 @@ class PlayerData(val player: OfflinePlayer) { fun switchVanish(): Boolean { player.getDataContainer()["vanish"] = !isVanishing return isVanishing.also { - if (it) vanishing += player.name!! else vanishing -= player.name!! + if (it) vanishing += player.name else vanishing -= player.name } } @@ -108,7 +108,7 @@ class PlayerData(val player: OfflinePlayer) { val vanishing = mutableSetOf() - fun getData(player: OfflinePlayer): PlayerData { + fun getData(player: Player): PlayerData { return data.computeIfAbsent(player.uniqueId) { PlayerData(player) } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/ext/HookPlaceholderAPI.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/ext/HookPlaceholderAPI.kt index 2e2ea54f..c3cabd94 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/ext/HookPlaceholderAPI.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/ext/HookPlaceholderAPI.kt @@ -2,11 +2,10 @@ package me.arasple.mc.trchat.module.internal.hook.ext import me.arasple.mc.trchat.api.event.TrChatEvent import me.arasple.mc.trchat.module.internal.command.main.CommandMute -import me.arasple.mc.trchat.util.Vars +import me.arasple.mc.trchat.util.PAPIUtil import me.arasple.mc.trchat.util.data import me.arasple.mc.trchat.util.session import org.bukkit.Bukkit -import org.bukkit.OfflinePlayer import org.bukkit.entity.Player import taboolib.common.platform.Platform import taboolib.common.platform.PlatformSide @@ -58,27 +57,9 @@ object HookPlaceholderAPI : PlaceholderExpansion { return "ERROR" } - override fun onPlaceholderRequest(player: OfflinePlayer?, args: String): String { - if (player != null) { - if (player.isOnline) { - return onPlaceholderRequest(player.player, args) - } - val params = args.split('_') - val data = player.data - return when (params[0].lowercase()) { - "spy" -> data.isSpying - "filter" -> data.isFilterEnabled - "mute" -> data.isMuted - "vanish" -> data.isVanishing - else -> "out of case" - }.toString() - } - return "ERROR" - } - @SubscribeEvent(priority = EventPriority.LOW) fun onChat(e: TrChatEvent) { - if (e.forward && !Vars.checkExpansions(e.session.player)) { + if (e.forward && !PAPIUtil.checkExpansions(e.session.player)) { e.isCancelled = true } } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/impl/HookDiscordSRV.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/impl/HookDiscordSRV.kt index 735365c1..9316d0f1 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/impl/HookDiscordSRV.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/hook/impl/HookDiscordSRV.kt @@ -4,9 +4,11 @@ import github.scarsz.discordsrv.DiscordSRV import github.scarsz.discordsrv.api.Subscribe import github.scarsz.discordsrv.api.events.DiscordGuildMessagePreBroadcastEvent import github.scarsz.discordsrv.api.events.GameChatMessagePreProcessEvent +import me.arasple.mc.trchat.TrChat import me.arasple.mc.trchat.module.internal.hook.HookAbstract import me.arasple.mc.trchat.util.session import org.bukkit.entity.Player +import taboolib.common.platform.function.adaptPlayer class HookDiscordSRV : HookAbstract() { @@ -15,7 +17,10 @@ class HookDiscordSRV : HookAbstract() { DiscordSRV.api.subscribe(object { @Subscribe fun onChatPreProcess(e: GameChatMessagePreProcessEvent) { - if (e.player.session.lastChannel?.settings?.sendToDiscord == false) { + val channel = e.player.session.lastChannel ?: return + if (channel.settings.sendToDiscord) { + e.message = TrChat.api().getFilterManager().filter(e.message, adaptPlayer(e.player)).filtered + } else { e.isCancelled = true } } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerAnvilChange.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerAnvilChange.kt index b1b98d2e..206e5242 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerAnvilChange.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerAnvilChange.kt @@ -44,7 +44,7 @@ object ListenerAnvilChange { return@modifyMeta } if (filter) { - setDisplayName(TrChat.api().getFilterManager().filter(displayName, player = adaptPlayer(p)).filtered) + setDisplayName(TrChat.api().getFilterManager().filter(displayName, adaptPlayer(p)).filtered) } if (color) { if (p.hasPermission("trchat.color.simple")) { diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerJoin.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerJoin.kt index 13a0fdca..1770f6f3 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerJoin.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerJoin.kt @@ -13,7 +13,6 @@ import taboolib.common.platform.event.EventPriority import taboolib.common.platform.event.SubscribeEvent import taboolib.common.platform.function.adaptPlayer import taboolib.common.platform.function.submit -import taboolib.expansion.playerDataContainer import taboolib.expansion.setupDataContainer /** @@ -29,9 +28,7 @@ object ListenerJoin { fun onJoin(e: PlayerJoinEvent) { val player = e.player - if (!playerDataContainer.containsKey(player.uniqueId)) { - player.setupDataContainer() - } + player.setupDataContainer() player.data player.session diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerPackets.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerPackets.kt index 33f25161..75729807 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerPackets.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerPackets.kt @@ -1,6 +1,6 @@ package me.arasple.mc.trchat.module.internal.listener -import me.arasple.mc.trchat.util.session +import me.arasple.mc.trchat.module.display.ChatSession import taboolib.common.platform.Platform import taboolib.common.platform.PlatformSide import taboolib.common.platform.event.SubscribeEvent @@ -32,7 +32,7 @@ object ListenerPackets { */ @SubscribeEvent fun recall(e: PacketSendEvent) { - val session = e.player.session + val session = ChatSession.sessions[e.player.uniqueId] ?: return when (e.packet.name) { "ClientboundSystemChatPacket" -> { session.addMessage(e.packet) diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerSignChange.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerSignChange.kt index f899c6a5..1b3a8b17 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerSignChange.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/module/internal/listener/ListenerSignChange.kt @@ -35,7 +35,7 @@ object ListenerSignChange { for (index in e.lines.indices) { if (filter) { - e.setLine(index, TrChat.api().getFilterManager().filter(e.getLine(index) ?: "", player = adaptPlayer(p)).filtered) + e.setLine(index, TrChat.api().getFilterManager().filter(e.getLine(index) ?: "", adaptPlayer(p)).filtered) } if (color) { if (TrChatBukkit.isPaperEnv && p.hasPermission("trchat.color.simple")) { diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/BukkitUtil.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/BukkitUtil.kt index 042fd87e..a4c53048 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/BukkitUtil.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/BukkitUtil.kt @@ -14,9 +14,6 @@ import org.bukkit.command.CommandSender import org.bukkit.entity.Player import org.bukkit.event.inventory.InventoryType import taboolib.common.util.unsafeLazy -import taboolib.expansion.DataContainer -import taboolib.expansion.playerDataContainer -import taboolib.expansion.playerDatabase import taboolib.module.chat.ComponentText import taboolib.module.nms.MinecraftVersion import taboolib.module.ui.MenuHolder @@ -79,7 +76,7 @@ fun String.parseInline(sender: CommandSender, vars: Map = emptyMap( inline val Player.session get() = ChatSession.getSession(this) -inline val OfflinePlayer.data get() = PlayerData.getData(this) +inline val Player.data get() = PlayerData.getData(this) fun Player.checkMute(): Boolean { if (TrChatBukkit.isGlobalMuting && !hasPermission("trchat.bypass.globalmute")) { @@ -94,10 +91,6 @@ fun Player.checkMute(): Boolean { return true } -fun OfflinePlayer.getDataContainer(): DataContainer { - return playerDataContainer.computeIfAbsent(uniqueId) { DataContainer(uniqueId.parseString(), playerDatabase!!) } -} - fun Any.sendComponent(sender: Any?, component: ComponentText) { BukkitComponentManager.sendComponent(this, component, sender) } diff --git a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/Vars.kt b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/PAPIUtil.kt similarity index 99% rename from project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/Vars.kt rename to project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/PAPIUtil.kt index f6bd7699..c776dfbe 100644 --- a/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/Vars.kt +++ b/project/runtime-bukkit/src/main/kotlin/me/arasple/mc/trchat/util/PAPIUtil.kt @@ -14,7 +14,7 @@ import taboolib.platform.util.sendLang * @date 2019/11/29 21:29 */ @PlatformSide([Platform.BUKKIT]) -object Vars { +object PAPIUtil { @ConfigNode("Options.Depend-Expansions", "settings.yml") var depends = emptyList() diff --git a/project/runtime-bukkit/src/main/resources/filter.yml b/project/runtime-bukkit/src/main/resources/filter.yml index a6c4ccb8..c17453a2 100644 --- a/project/runtime-bukkit/src/main/resources/filter.yml +++ b/project/runtime-bukkit/src/main/resources/filter.yml @@ -9,10 +9,10 @@ Cloud-Thesaurus: Urls: - 'https://raw.githubusercontent.com/Yurinann/Filter-Thesaurus-Cloud/main/database.json' # 感谢南城提供的词库 -Local: - - 'NMSL' - - 'fuck' - - 'shit' +Local: |- + NMSL + fuck + shit Ignored-Punctuations: ['!','.',',','#','$','%','&','*','(',')','|','?','/','@','"','\',';','[',']','{','}','+','~','-','_','=','^','<','>',' ',' ','!','。',',','¥','(',')','?','、','“','‘',';','【','】','——','……','《','》','\\', '`'] WhiteList: ['has been']