Adds tons of changes to messages
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package net.knarcraft.blacksmith.util;
|
||||
|
||||
import net.knarcraft.blacksmith.config.SettingValueType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -28,9 +33,40 @@ public final class TabCompleteValuesHelper {
|
||||
case STRING -> getStrings();
|
||||
case PERCENTAGE -> getPercentages();
|
||||
case STRING_LIST -> getReforgeAbleMaterials();
|
||||
case MATERIAL -> getAllReforgeAbleMaterials();
|
||||
case ENCHANTMENT -> getAllEnchantments();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a complete list of all reforge-able materials
|
||||
*
|
||||
* @return <p>A complete list of reforge-able materials</p>
|
||||
*/
|
||||
private static List<String> getAllReforgeAbleMaterials() {
|
||||
List<String> reforgeAbleMaterials = new ArrayList<>();
|
||||
for (Material material : Material.values()) {
|
||||
ItemStack item = new ItemStack(material);
|
||||
if (item.getItemMeta() instanceof Damageable && EnchantmentTarget.BREAKABLE.includes(item)) {
|
||||
reforgeAbleMaterials.add(material.name());
|
||||
}
|
||||
}
|
||||
return reforgeAbleMaterials;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a complete list of enchantments
|
||||
*
|
||||
* @return <p>A complete list of enchantments</p>
|
||||
*/
|
||||
private static List<String> getAllEnchantments() {
|
||||
List<String> enchantments = new ArrayList<>();
|
||||
for (Enchantment enchantment : Enchantment.values()) {
|
||||
enchantments.add(enchantment.toString());
|
||||
}
|
||||
return enchantments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets some example possible values for reforge-able materials
|
||||
*
|
||||
|
Reference in New Issue
Block a user