From dcf38d3e807bc557c6bc727dfcc8cce485818f7c Mon Sep 17 00:00:00 2001 From: Cosine-A <100404990+Cosine-A@users.noreply.github.com> Date: Sun, 17 Nov 2024 17:57:35 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A7=88=EC=9D=B8=ED=81=AC=EB=9E=98?= =?UTF-8?q?=ED=94=84=ED=8A=B8=20=EC=98=A4=ED=94=84=EB=9D=BC=EC=9D=B8=20?= =?UTF-8?q?=ED=94=8C=EB=A0=88=EC=9D=B4=EC=96=B4=20=EB=AA=BB=EC=B0=BE?= =?UTF-8?q?=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- .../kr/cosine/discordauth/service/AuthService.kt | 11 ++++++----- src/main/resources/plugin.yml | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 52eb53a..d2163c2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } group = "kr.cosine.discordauth" -version = "1.2.0" +version = "1.2.1" repositories { maven("https://maven.hqservice.kr/repository/maven-public") diff --git a/src/main/kotlin/kr/cosine/discordauth/service/AuthService.kt b/src/main/kotlin/kr/cosine/discordauth/service/AuthService.kt index f68c13a..335a88c 100644 --- a/src/main/kotlin/kr/cosine/discordauth/service/AuthService.kt +++ b/src/main/kotlin/kr/cosine/discordauth/service/AuthService.kt @@ -21,6 +21,7 @@ import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder import net.md_5.bungee.api.chat.ClickEvent import net.md_5.bungee.api.chat.HoverEvent import net.md_5.bungee.api.chat.TextComponent +import org.bukkit.Bukkit import org.bukkit.command.CommandSender import org.bukkit.entity.Player import java.time.LocalDateTime @@ -100,7 +101,7 @@ class AuthService( return reply("올바르지 않은 코드입니다.") } val playerUniqueId = authCodeRegistry.removeByAuthCode(code) ?: return reply("UUID를 찾지 못했습니다.") - val offlinePlayer = server.getOfflinePlayer(playerUniqueId) + val offlinePlayer = Bukkit.getOfflinePlayer(playerUniqueId) val minecraftName = offlinePlayer.name ?: return reply("마인크래프트 닉네임을 찾지 못했습니다.") authorizedPlayerRegistry.setAuthorizedPlayer(playerUniqueId, userId) @@ -168,7 +169,7 @@ class AuthService( suspend fun removeAuth(name: String): Boolean { return withContext(Dispatchers.IO) { - val targetOfflinePlayer = server.getOfflinePlayer(name) + val targetOfflinePlayer = Bukkit.getOfflinePlayer(name) val targetUniqueId = targetOfflinePlayer.uniqueId if (!isAuthorizedPlayer(targetUniqueId)) { return@withContext false @@ -188,8 +189,8 @@ class AuthService( plugin.launch(Dispatchers.IO) { val target = runCatching { val targetUniqueId = UUID.fromString(uniqueIdOrName) - server.getOfflinePlayer(targetUniqueId) - }.getOrNull() ?: server.getOfflinePlayer(uniqueIdOrName) + Bukkit.getOfflinePlayer(targetUniqueId) + }.getOrNull() ?: Bukkit.getOfflinePlayer(uniqueIdOrName) val targetUniqueId = target.uniqueId val targetDiscordId = authorizedPlayerRegistry.findDiscordId(targetUniqueId) ?: run { sender.sendMessage("§c인증되지 않은 유저입니다.") @@ -214,7 +215,7 @@ class AuthService( sender.sendMessage("§c인증하지 않은 유저입니다.") return@launch } - val target = server.getOfflinePlayer(targetUniqueId) + val target = Bukkit.getOfflinePlayer(targetUniqueId) val targetMember = botService.findMemberById(discordId) sender.sendMessage("§6${targetMember?.user?.name ?: "§c불러오지 못함"}§6님의 마인크래프트 정보") sender.spigot().sendMessage(createClipboardTextComponent("디스코드 아이디", "§7(${discordId})", "$discordId")) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7cf9a10..3ec1607 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: HQDiscordAuth main: kr.cosine.discordauth.HQDiscordAuth -version: 1.2.0 +version: 1.2.1 api-version: 1.17 author: Cosine_A depend: