Merge pull request #323 from 0ft3n/master

vanillaenchants.yml reverting fix
This commit is contained in:
Will FP
2022-10-23 22:57:47 +01:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -84,7 +84,11 @@ class CommandGiveRandomBook(plugin: EcoPlugin) : PluginCommand(
1 -> Bukkit.getOnlinePlayers().map { it.name }
2 -> (EnchantmentRarities.values().map { it.id } + EnchantmentTypes.values().map { it.id })
3 -> (1..10).map { it.toString() }
4 -> ((args[3].toIntOrNull() ?: 1)..(args[3].toIntOrNull() ?: 1) + 10).map { it.toString() }
4 -> {
val startLevel = args[3].toIntOrNull() ?: 1
val endLevel = startLevel + 10
(startLevel..endLevel).map { it.toString() }
}
else -> emptyList()
}
}

View File

@@ -3,8 +3,13 @@ package com.willfp.ecoenchants.config
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.config.BaseConfig
import com.willfp.eco.core.config.ConfigType
import com.willfp.eco.core.config.ExtendableConfig
import com.willfp.ecoenchants.enchants.EcoEnchant
import org.bukkit.enchantments.Enchantment
class TypesYml(plugin: EcoPlugin) : BaseConfig("types", plugin, true, ConfigType.YAML)
class TargetsYml(plugin: EcoPlugin) : BaseConfig("targets", plugin, true, ConfigType.YAML)
class RarityYml(plugin: EcoPlugin) : BaseConfig("rarity", plugin, true, ConfigType.YAML)
class VanillaEnchantsYml(plugin: EcoPlugin) : BaseConfig("vanillaenchants", plugin, true, ConfigType.YAML)
class VanillaEnchantsYml(plugin: EcoPlugin) : ExtendableConfig("vanillaenchants", true, plugin,
plugin.javaClass, "", ConfigType.YAML, *Enchantment.values().filter { it !is EcoEnchant }
.map { it.key.key.lowercase() }.toTypedArray())