From 158228c11d5b49f910ba7992b20a4e44483da697 Mon Sep 17 00:00:00 2001 From: Caadiq Date: Thu, 23 Apr 2026 14:58:21 +0900 Subject: [PATCH] =?UTF-8?q?chore(serverstatus):=20NeoForge=2021.1.227=20?= =?UTF-8?q?=EC=97=85=EA=B7=B8=EB=A0=88=EC=9D=B4=EB=93=9C=20=EB=B0=8F=20?= =?UTF-8?q?=EC=BB=B4=ED=8C=8C=EC=9D=BC=EB=9F=AC=20=EA=B2=BD=EA=B3=A0=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - NeoForge 21.1.77 → 21.1.227, moddev 2.0.141, Kotlin 2.3.0, KFF 5.11.0 - PlayerStatsCollector: BuiltInRegistries.getKey()가 non-null을 반환하므로 불필요한 safe call(?.) 6곳 제거 - LogUploadService: deprecated URL(String) 생성자를 URI(...).toURL()로 교체 Co-Authored-By: Claude Opus 4.7 (1M context) --- ServerStatus/build.gradle.kts | 6 +++--- ServerStatus/gradle.properties | 6 +++--- .../serverstatus/data/PlayerStatsCollector.kt | 16 ++++++---------- .../beemer/serverstatus/log/LogUploadService.kt | 4 ++-- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/ServerStatus/build.gradle.kts b/ServerStatus/build.gradle.kts index df2fe34..e41f37f 100644 --- a/ServerStatus/build.gradle.kts +++ b/ServerStatus/build.gradle.kts @@ -1,7 +1,7 @@ plugins { - id("net.neoforged.moddev") version "2.0.80" - kotlin("jvm") version "2.0.0" - kotlin("plugin.serialization") version "2.0.0" + id("net.neoforged.moddev") version "2.0.141" + kotlin("jvm") version "2.3.0" + kotlin("plugin.serialization") version "2.3.0" } version = project.property("mod_version") as String diff --git a/ServerStatus/gradle.properties b/ServerStatus/gradle.properties index ae632a1..c6cc3de 100644 --- a/ServerStatus/gradle.properties +++ b/ServerStatus/gradle.properties @@ -9,13 +9,13 @@ mod_authors=beemer # NeoForge 버전 minecraft_version=1.21.1 minecraft_version_range=[1.21.1,1.22) -neo_version=21.1.77 +neo_version=21.1.227 neo_version_range=[21.1.0,) loader_version_range=[4,) # Kotlin 버전 -kotlin_version=2.0.0 -kotlin_for_forge_version=5.6.0 +kotlin_version=2.3.0 +kotlin_for_forge_version=5.11.0 # Gradle org.gradle.jvmargs=-Xmx3G diff --git a/ServerStatus/src/main/kotlin/com/beemer/serverstatus/data/PlayerStatsCollector.kt b/ServerStatus/src/main/kotlin/com/beemer/serverstatus/data/PlayerStatsCollector.kt index 5b17f63..73aef06 100644 --- a/ServerStatus/src/main/kotlin/com/beemer/serverstatus/data/PlayerStatsCollector.kt +++ b/ServerStatus/src/main/kotlin/com/beemer/serverstatus/data/PlayerStatsCollector.kt @@ -51,7 +51,7 @@ class PlayerStatsCollector { BuiltInRegistries.BLOCK.forEach { block -> val mined = statsManager.getValue(Stats.BLOCK_MINED.get(block)) if (mined > 0) { - val blockId = BuiltInRegistries.BLOCK.getKey(block)?.path ?: return@forEach + val blockId = BuiltInRegistries.BLOCK.getKey(block).path itemStats.getOrPut(blockId) { ItemStat() }.mined = mined } } @@ -60,7 +60,7 @@ class PlayerStatsCollector { BuiltInRegistries.ITEM.forEach { item -> val picked = statsManager.getValue(Stats.ITEM_PICKED_UP.get(item)) if (picked > 0) { - val itemId = BuiltInRegistries.ITEM.getKey(item)?.path ?: return@forEach + val itemId = BuiltInRegistries.ITEM.getKey(item).path itemStats.getOrPut(itemId) { ItemStat() }.pickedUp = picked } } @@ -69,7 +69,7 @@ class PlayerStatsCollector { BuiltInRegistries.ITEM.forEach { item -> val used = statsManager.getValue(Stats.ITEM_USED.get(item)) if (used > 0) { - val itemId = BuiltInRegistries.ITEM.getKey(item)?.path ?: return@forEach + val itemId = BuiltInRegistries.ITEM.getKey(item).path itemStats.getOrPut(itemId) { ItemStat() }.used = used } } @@ -78,7 +78,7 @@ class PlayerStatsCollector { BuiltInRegistries.ITEM.forEach { item -> val crafted = statsManager.getValue(Stats.ITEM_CRAFTED.get(item)) if (crafted > 0) { - val itemId = BuiltInRegistries.ITEM.getKey(item)?.path ?: return@forEach + val itemId = BuiltInRegistries.ITEM.getKey(item).path itemStats.getOrPut(itemId) { ItemStat() }.crafted = crafted } } @@ -91,9 +91,7 @@ class PlayerStatsCollector { try { val killed = statsManager.getValue(Stats.ENTITY_KILLED.get(entityType)) if (killed > 0) { - val entityId = - BuiltInRegistries.ENTITY_TYPE.getKey(entityType)?.path - ?: return@forEach + val entityId = BuiltInRegistries.ENTITY_TYPE.getKey(entityType).path mobStats.getOrPut(entityId) { MobStat() }.killed = killed } } catch (e: Exception) {} @@ -104,9 +102,7 @@ class PlayerStatsCollector { try { val killedBy = statsManager.getValue(Stats.ENTITY_KILLED_BY.get(entityType)) if (killedBy > 0) { - val entityId = - BuiltInRegistries.ENTITY_TYPE.getKey(entityType)?.path - ?: return@forEach + val entityId = BuiltInRegistries.ENTITY_TYPE.getKey(entityType).path mobStats.getOrPut(entityId) { MobStat() }.killedBy = killedBy } } catch (e: Exception) {} diff --git a/ServerStatus/src/main/kotlin/com/beemer/serverstatus/log/LogUploadService.kt b/ServerStatus/src/main/kotlin/com/beemer/serverstatus/log/LogUploadService.kt index e34856e..edc0134 100644 --- a/ServerStatus/src/main/kotlin/com/beemer/serverstatus/log/LogUploadService.kt +++ b/ServerStatus/src/main/kotlin/com/beemer/serverstatus/log/LogUploadService.kt @@ -4,7 +4,7 @@ import com.beemer.serverstatus.ServerStatusMod import java.io.DataOutputStream import java.io.File import java.net.HttpURLConnection -import java.net.URL +import java.net.URI import java.util.concurrent.Executors /** 서버 시작 시 이전 로그 파일을 백엔드로 업로드하는 서비스 */ @@ -69,7 +69,7 @@ object LogUploadService { /** 파일 업로드 (multipart/form-data) */ private fun uploadFile(backendUrl: String, serverId: String, file: File) { - val url = URL("$backendUrl/api/admin/logs/upload") + val url = URI("$backendUrl/api/admin/logs/upload").toURL() val boundary = "----FormBoundary${System.currentTimeMillis()}" val connection = url.openConnection() as HttpURLConnection