diff --git a/src/main/kotlin/click/seichi/originspawn/presenter/SpawnLocationExt.kt b/src/main/kotlin/click/seichi/originspawn/presenter/SpawnLocationExt.kt index b23b649..5506ff2 100644 --- a/src/main/kotlin/click/seichi/originspawn/presenter/SpawnLocationExt.kt +++ b/src/main/kotlin/click/seichi/originspawn/presenter/SpawnLocationExt.kt @@ -5,7 +5,7 @@ import org.bukkit.Bukkit import org.bukkit.Location fun Location.toSpawnPoint() = - world?.let { SpawnPoint(it.name, LocX(x), LocY(y), LocZ(z), Yaw(yaw), Pitch(pitch)) } + SpawnPoint(world!!.name, LocX(x), LocY(y), LocZ(z), Yaw(yaw), Pitch(pitch)) fun SpawnPoint.toBukkitLocation() = Bukkit.getWorld(worldName)?.let { world -> Location(world, x.value, y.value, z.value, yaw.value, pitch.value) diff --git a/src/main/kotlin/click/seichi/originspawn/presenter/commands/Update.kt b/src/main/kotlin/click/seichi/originspawn/presenter/commands/Update.kt index c89e90b..4bc257a 100644 --- a/src/main/kotlin/click/seichi/originspawn/presenter/commands/Update.kt +++ b/src/main/kotlin/click/seichi/originspawn/presenter/commands/Update.kt @@ -16,9 +16,7 @@ object Update : CommandExecutor("update", "スポーン地点の設定を現在 } val spawnPoint = sender.location.toSpawnPoint() - if (spawnPoint != null) { - SPAWN_POINT_PERSISTENCE.save(spawnPoint) - } + SPAWN_POINT_PERSISTENCE.save(spawnPoint) val updatedMessage = "スポーン地点の設定を更新しました。" messageSender.info(updatedMessage)