Changed MissingDependencyException to use a set

This commit is contained in:
Auxilor 2023-04-20 18:25:03 +01:00
parent c0435a659e
commit 3a693f7a05
2 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ abstract class EcoEnchant(
}
private fun checkDependencies() {
val missingPlugins = mutableListOf<String>()
val missingPlugins = mutableSetOf<String>()
for (dependency in config.getStrings("dependencies")) {
if (!Bukkit.getPluginManager().plugins.map { it.name }.containsIgnoreCase(dependency)) {

View File

@ -4,7 +4,7 @@ import com.willfp.eco.core.EcoPlugin
import com.willfp.ecoenchants.EcoEnchantsPlugin
class MissingDependencyException(
val plugins: List<String>
val plugins: Set<String>
) : Exception() {
override val message = "Missing the following plugins: ${plugins.joinToString(", ")}"
}
@ -12,7 +12,7 @@ class MissingDependencyException(
// Plugin names mapped to enchants that aren't installed.
private val prompts = mutableMapOf<String, Int>()
fun addPluginPrompt(plugin: EcoEnchantsPlugin, plugins: List<String>) {
fun addPluginPrompt(plugin: EcoEnchantsPlugin, plugins: Set<String>) {
if (!plugin.isLoaded) {
return
}