mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-21 00:21:20 +01:00
Changed MissingDependencyException to use a set
This commit is contained in:
parent
c0435a659e
commit
3a693f7a05
@ -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)) {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user