From 35f0bd3f633f3da98deb7c8a3dae9daa0817bcb8 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 16 Apr 2021 16:25:15 +0100 Subject: [PATCH] Fixed SkillClass --- .../willfp/ecoskills/classes/SkillClass.java | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/classes/SkillClass.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/classes/SkillClass.java index c23f2ad1..581245bb 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/classes/SkillClass.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/classes/SkillClass.java @@ -1,18 +1,9 @@ package com.willfp.ecoskills.classes; -import com.willfp.eco.util.StringUtils; import com.willfp.ecoskills.config.ClassConfig; -import com.willfp.ecoskills.enchantments.EcoEnchants; -import com.willfp.ecoskills.enchantments.util.EnchantmentUtils; import lombok.Getter; -import org.apache.commons.lang.Validate; -import org.bukkit.Bukkit; -import org.bukkit.World; import org.jetbrains.annotations.NotNull; -import java.util.List; -import java.util.stream.Collectors; - public abstract class SkillClass { /** * The name of the class. @@ -37,31 +28,5 @@ public abstract class SkillClass { public void update() { config.update(); - config.loadFromLang(); - rarity = config.getRarity(); - Validate.notNull(rarity, "Rarity specified in " + this.permissionName + " is invalid!"); - conflicts = config.getEnchantments(EcoEnchants.GENERAL_LOCATION + "conflicts"); - grindstoneable = config.getBool(EcoEnchants.GENERAL_LOCATION + "grindstoneable"); - availableFromTable = config.getBool(EcoEnchants.OBTAINING_LOCATION + "table"); - availableFromVillager = config.getBool(EcoEnchants.OBTAINING_LOCATION + "villager"); - availableFromLoot = config.getBool(EcoEnchants.OBTAINING_LOCATION + "loot"); - maxLevel = config.getInt(EcoEnchants.GENERAL_LOCATION + "maximum-level", 1); - name = StringUtils.translate(config.getString("name")); - description = StringUtils.translate(config.getString("description")); - disabledWorldNames.clear(); - disabledWorldNames.addAll(config.getStrings(EcoEnchants.GENERAL_LOCATION + "disabled-in-worlds")); - disabledWorlds.clear(); - List worldNames = Bukkit.getWorlds().stream().map(World::getName).map(String::toLowerCase).collect(Collectors.toList()); - List disabledExistingWorldNames = disabledWorldNames.stream().filter(s -> worldNames.contains(s.toLowerCase())).collect(Collectors.toList()); - disabledWorlds.addAll(Bukkit.getWorlds().stream().filter(world -> disabledExistingWorldNames.contains(world.getName().toLowerCase())).collect(Collectors.toList())); - targets.clear(); - targetMaterials.clear(); - targets.addAll(config.getTargets()); - targets.forEach(enchantmentTarget -> targetMaterials.addAll(enchantmentTarget.getMaterials())); - enabled = config.getBool("enabled"); - EnchantmentUtils.registerPlaceholders(this); - - postUpdate(); - this.register(); } }