Fixes some bugs
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

Fixes some config commands not being registered
Bumps KnarLib version to include bug-fix
Fixes and improves tab-completion for enchantment block-list
This commit is contained in:
2024-05-04 14:11:43 +02:00
parent 7e5525bd00
commit f9463f58d1
9 changed files with 51 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ package net.knarcraft.blacksmith.command.blacksmith;
import net.knarcraft.blacksmith.config.SettingValueType;
import net.knarcraft.blacksmith.config.blacksmith.BlacksmithSetting;
import net.knarcraft.blacksmith.util.InputParsingHelper;
import net.knarcraft.knarlib.util.TabCompletionHelper;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
@@ -53,7 +54,7 @@ public class BlackSmithConfigTabCompleter implements TabCompleter {
return new ArrayList<>();
}
}
return null;
return new ArrayList<>();
}
/**
@@ -119,6 +120,11 @@ public class BlackSmithConfigTabCompleter implements TabCompleter {
*/
private List<String> getCompletions(@NotNull BlacksmithSetting blacksmithSetting,
@NotNull String commandValue) {
if (blacksmithSetting == BlacksmithSetting.ENCHANTMENT_BLOCK_LIST) {
return TabCompletionHelper.getStringList(getTabCompletions(SettingValueType.ENCHANTMENT),
commandValue, TabCompletionHelper::filterMatchingContains);
}
List<String> returnValues = filterMatchingContains(
getTabCompletions(blacksmithSetting.getValueType()), commandValue);
if (blacksmithSetting == BlacksmithSetting.BASE_PRICE ||