From 1ad0d20deade39f542b76722ba7700c8c4ee3d52 Mon Sep 17 00:00:00 2001 From: xiaoyv404 Date: Fri, 22 Dec 2023 20:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0MCG=E6=9D=83=E9=99=90?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaoyv404/mirai/app/minecraftServer/ISU.kt | 2 +- .../model/mincraftServer/MinecraftServerPlayer.kt | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/com/xiaoyv404/mirai/app/minecraftServer/ISU.kt b/src/main/kotlin/com/xiaoyv404/mirai/app/minecraftServer/ISU.kt index a9c60eba..106739f4 100644 --- a/src/main/kotlin/com/xiaoyv404/mirai/app/minecraftServer/ISU.kt +++ b/src/main/kotlin/com/xiaoyv404/mirai/app/minecraftServer/ISU.kt @@ -171,7 +171,7 @@ class ISU : NfApp(), IFshApp { private suspend fun findOP(msg: MessageEvent): Boolean { val op = MinecraftServerPlayer().getAllOnlinePlayers().toMutableList() op.removeIf { - it.permissions.code == null + it.permissions == Permissions.Default } if (op.isEmpty()) msg.reply("没有呢 :(") diff --git a/src/main/kotlin/com/xiaoyv404/mirai/model/mincraftServer/MinecraftServerPlayer.kt b/src/main/kotlin/com/xiaoyv404/mirai/model/mincraftServer/MinecraftServerPlayer.kt index c5b13d96..ccdf0ddc 100644 --- a/src/main/kotlin/com/xiaoyv404/mirai/model/mincraftServer/MinecraftServerPlayer.kt +++ b/src/main/kotlin/com/xiaoyv404/mirai/model/mincraftServer/MinecraftServerPlayer.kt @@ -41,12 +41,11 @@ object MinecraftServerPlayers : Table("MinecraftServerPla val permissions = enum("permissions").bindTo { it.permissions } } -enum class Permissions(val code: Long?, val permissionName: String) { - Default(null,"毛玉"), - Basic(5, "妖怪"), - NPCEditor(4, "读心妖怪"), - WorldEditor(3, "工业妖怪"), - WNEditor(2, "大妖怪"), - OP(1, "妖怪贤者"), - Submit(0, "服主"), +enum class Permissions(val permissionName: String) { + Default("毛玉"), + Basic("妖怪"), + NPCEditor("读心妖怪"), + WorldEditor("工业妖怪"), + WNEditor("大妖怪"), + OP("妖怪贤者"), } \ No newline at end of file