Skip to content

Commit

Permalink
Naming didn't have a get() so null happened
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawsson committed Jul 1, 2024
1 parent a7457ab commit c6b0416
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ data class Plugin(
val platforms: MutableMap<MarketplacePlatform, PlatformPlugin>,
) {
val highestPriorityPlatform get() = MarketplacePlatform.entries.find(platforms::containsKey) ?: platforms.keys.first()

val downloadableName = name.replace(Regex("[/\\\\]"), "")
val downloadableName get() = name.replace(Regex("[/\\\\]"), "")
val totalDownloads: Int get() = platforms.values.sumOf { platform -> platform.downloads }

fun getFirstPlatform(): PlatformPlugin? = platforms.values.firstOrNull()

Expand All @@ -30,8 +30,6 @@ data class Plugin(
MarketplacePlatform.HANGAR -> "https://hangar.papermc.io/${currentPlatform.author}/${currentPlatform.id}"
}
}

val totalDownloads: Int get() = platforms.values.sumOf { platform -> platform.downloads }
}

data class PlatformPlugin(
Expand Down

0 comments on commit c6b0416

Please sign in to comment.