mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-21 14:55:17 +01:00
Updated to use new libreforge features
This commit is contained in:
parent
fdc3bdb236
commit
9353dc601b
@ -20,7 +20,9 @@ import com.willfp.ecoenchants.type.EnchantmentTypes
|
||||
import com.willfp.libreforge.ViolationContext
|
||||
import com.willfp.libreforge.conditions.ConditionList
|
||||
import com.willfp.libreforge.conditions.Conditions
|
||||
import com.willfp.libreforge.conditions.emptyConditionList
|
||||
import com.willfp.libreforge.effects.EffectList
|
||||
import com.willfp.libreforge.effects.emptyEffectList
|
||||
import net.kyori.adventure.text.Component
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Material
|
||||
@ -128,7 +130,7 @@ abstract class EcoEnchant(
|
||||
conditions = if (plugin.isLoaded) Conditions.compile(
|
||||
config.getSubsections("conditions"),
|
||||
ViolationContext(plugin, "Enchantment $id")
|
||||
) else ConditionList(emptyList())
|
||||
) else emptyConditionList()
|
||||
|
||||
if (Bukkit.getPluginManager().getPermission("ecoenchants.fromtable.$id") == null) {
|
||||
val permission = Permission(
|
||||
@ -197,7 +199,7 @@ abstract class EcoEnchant(
|
||||
}
|
||||
|
||||
open fun createLevel(level: Int) =
|
||||
EcoEnchantLevel(this, level, EffectList(emptyList()), conditions, plugin)
|
||||
EcoEnchantLevel(this, level, emptyEffectList(), conditions, plugin)
|
||||
|
||||
fun registerListener(listener: Listener) {
|
||||
this.plugin.eventManager.registerListener(listener)
|
||||
|
@ -7,6 +7,7 @@ import com.willfp.libreforge.ViolationContext
|
||||
import com.willfp.libreforge.conditions.ConditionList
|
||||
import com.willfp.libreforge.effects.EffectList
|
||||
import com.willfp.libreforge.effects.Effects
|
||||
import com.willfp.libreforge.effects.emptyEffectList
|
||||
import com.willfp.libreforge.loader.LibreforgePlugin
|
||||
import java.util.Objects
|
||||
|
||||
@ -25,7 +26,7 @@ class LibReforgeEcoEnchant(
|
||||
effects = if (plugin.isLoaded) Effects.compile(
|
||||
config.getSubsections("effects"),
|
||||
ViolationContext(plugin, "Enchantment $id")
|
||||
) else EffectList(emptyList())
|
||||
) else emptyEffectList()
|
||||
}
|
||||
|
||||
override fun createLevel(level: Int): EcoEnchantLevel =
|
||||
|
Loading…
Reference in New Issue
Block a user