Updates Spigot, and fixes depreciated code
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@@ -3,7 +3,9 @@ package net.knarcraft.blacksmith.util;
|
||||
import net.knarcraft.blacksmith.config.SettingValueType;
|
||||
import net.knarcraft.blacksmith.config.SmithPreset;
|
||||
import net.knarcraft.blacksmith.config.SmithPresetFilter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -82,8 +84,13 @@ public final class TabCompleteValuesHelper {
|
||||
* @return <p>A complete list of enchantments</p>
|
||||
*/
|
||||
private static @NotNull List<String> getAllEnchantments() {
|
||||
Registry<Enchantment> enchantmentRegistry = Bukkit.getRegistry(Enchantment.class);
|
||||
if (enchantmentRegistry == null) {
|
||||
throw new RuntimeException("Unable to get the enchantment registry");
|
||||
}
|
||||
|
||||
List<String> enchantments = new ArrayList<>();
|
||||
for (Enchantment enchantment : Enchantment.values()) {
|
||||
for (Enchantment enchantment : enchantmentRegistry) {
|
||||
enchantments.add(enchantment.getKey().getKey());
|
||||
}
|
||||
return enchantments;
|
||||
|
Reference in New Issue
Block a user