Fixed essentials registration failing stopping the plugin from loading

This commit is contained in:
Auxilor 2021-11-16 15:11:30 +00:00
parent 6c19496ee8
commit 7c92ec8efe

View File

@ -1,6 +1,7 @@
package com.willfp.ecoenchants.integrations.registration;
import lombok.experimental.UtilityClass;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import java.util.HashSet;
@ -26,6 +27,12 @@ public class RegistrationManager {
* Register all {@link com.willfp.ecoenchants.enchantments.EcoEnchant}s with Essentials.
*/
public static void registerEnchantments() {
REGISTERED.forEach(RegistrationWrapper::registerAllEnchantments);
for (RegistrationWrapper wrapper : REGISTERED) {
try {
wrapper.registerAllEnchantments();
} catch (Exception e) {
Bukkit.getLogger().warning("Failed to register enchantments for plugin " + wrapper.getPluginName());
}
}
}
}