mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added checker for invalid targets
This commit is contained in:
parent
2bda3b26c1
commit
00c6f6d494
@ -3,7 +3,7 @@ version rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":eco-core:core-proxy")
|
||||
compileOnly 'org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT'
|
||||
compileOnly 'org.spigotmc:spigot:1.16.4-R0.1-SNAPSHOT'
|
||||
compileOnly 'commons-io:commons-io:2.8.0'
|
||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.0-SNAPSHOT'
|
||||
compileOnly 'net.ess3:EssentialsX:2.18.1'
|
||||
|
@ -7,6 +7,7 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentRarity;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -74,6 +75,7 @@ public class EnchantmentConfig extends ExtendableConfig {
|
||||
|
||||
targetNames.forEach((s -> {
|
||||
if (EnchantmentTarget.getByName(s) == null) {
|
||||
Bukkit.getLogger().warning("Target specified in " + name + " is invalid!");
|
||||
return;
|
||||
}
|
||||
targets.add(EnchantmentTarget.getByName(s));
|
||||
|
Loading…
Reference in New Issue
Block a user