Writes a lot of code necessary for the scrapper
Adds the classes necessary for the new scrapper Partly implements some scrapper functionality Restructures some classes to reduce code duplication Moves some classes to make some classes easier to find Adds a bunch of TODOs where things have an unfinished implementation
This commit is contained in:
@@ -5,6 +5,7 @@ import net.knarcraft.blacksmith.config.SmithPreset;
|
||||
import net.knarcraft.blacksmith.config.SmithPresetFilter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -24,7 +25,7 @@ public final class TabCompleteValuesHelper {
|
||||
* @param valueType <p>The value type to get possible values for</p>
|
||||
* @return <p>The values to show the user</p>
|
||||
*/
|
||||
public static List<String> getTabCompletions(SettingValueType valueType) {
|
||||
public static @NotNull List<String> getTabCompletions(@NotNull SettingValueType valueType) {
|
||||
return switch (valueType) {
|
||||
case POSITIVE_INTEGER -> getPositiveIntegers();
|
||||
case BOOLEAN -> getBooleans();
|
||||
@@ -43,7 +44,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>Some example enchantment block lists</p>
|
||||
*/
|
||||
private static List<String> getExampleEnchantmentBlockLists() {
|
||||
private static @NotNull List<String> getExampleEnchantmentBlockLists() {
|
||||
List<String> exampleBlockLists = new ArrayList<>();
|
||||
exampleBlockLists.add(Enchantment.VANISHING_CURSE.getKey().getKey() + "," +
|
||||
Enchantment.BINDING_CURSE.getKey().getKey() + "," + Enchantment.MENDING.getKey().getKey());
|
||||
@@ -58,7 +59,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>A complete list of reforge-able material names</p>
|
||||
*/
|
||||
private static List<String> getAllReforgeAbleMaterialNames() {
|
||||
private static @NotNull List<String> getAllReforgeAbleMaterialNames() {
|
||||
List<String> reforgeAbleMaterials = new ArrayList<>();
|
||||
for (Material material : ItemHelper.getAllReforgeAbleMaterials()) {
|
||||
reforgeAbleMaterials.add(material.name());
|
||||
@@ -80,7 +81,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>A complete list of enchantments</p>
|
||||
*/
|
||||
private static List<String> getAllEnchantments() {
|
||||
private static @NotNull List<String> getAllEnchantments() {
|
||||
List<String> enchantments = new ArrayList<>();
|
||||
for (Enchantment enchantment : Enchantment.values()) {
|
||||
enchantments.add(enchantment.getKey().getKey());
|
||||
@@ -93,7 +94,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>Some example possible values for reforge-able materials</p>
|
||||
*/
|
||||
private static List<String> getReforgeAbleMaterials() {
|
||||
private static @NotNull List<String> getReforgeAbleMaterials() {
|
||||
List<String> stringLists = new ArrayList<>();
|
||||
for (SmithPreset preset : SmithPreset.values()) {
|
||||
stringLists.add("preset:" + preset.name());
|
||||
@@ -114,7 +115,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>Some example string values</p>
|
||||
*/
|
||||
private static List<String> getStrings() {
|
||||
private static @NotNull List<String> getStrings() {
|
||||
List<String> strings = new ArrayList<>(1);
|
||||
strings.add("&aExample message. Use & for color tags.");
|
||||
return strings;
|
||||
@@ -125,7 +126,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>Some example percentage values</p>
|
||||
*/
|
||||
private static List<String> getPercentages() {
|
||||
private static @NotNull List<String> getPercentages() {
|
||||
List<String> percentages = new ArrayList<>(6);
|
||||
percentages.add("0");
|
||||
percentages.add("10");
|
||||
@@ -141,7 +142,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>Some possible positive doubles</p>
|
||||
*/
|
||||
private static List<String> getPositiveDoubles() {
|
||||
private static @NotNull List<String> getPositiveDoubles() {
|
||||
List<String> positiveDoubles = new ArrayList<>(4);
|
||||
positiveDoubles.add("0.0");
|
||||
positiveDoubles.add("0.0001");
|
||||
@@ -156,7 +157,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>Some example positive integers</p>
|
||||
*/
|
||||
private static List<String> getPositiveIntegers() {
|
||||
private static @NotNull List<String> getPositiveIntegers() {
|
||||
List<String> positiveIntegers = new ArrayList<>(6);
|
||||
positiveIntegers.add("0");
|
||||
positiveIntegers.add("5");
|
||||
@@ -173,7 +174,7 @@ public final class TabCompleteValuesHelper {
|
||||
*
|
||||
* @return <p>The possible boolean values</p>
|
||||
*/
|
||||
private static List<String> getBooleans() {
|
||||
private static @NotNull List<String> getBooleans() {
|
||||
List<String> booleans = new ArrayList<>(2);
|
||||
booleans.add("True");
|
||||
booleans.add("False");
|
||||
|
Reference in New Issue
Block a user