Fixes some bugs
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
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:
@ -50,4 +50,9 @@ public enum SettingValueType {
|
||||
*/
|
||||
REFORGE_ABLE_ITEMS,
|
||||
|
||||
/**
|
||||
* A list of enchantments
|
||||
*/
|
||||
ENCHANTMENT_LIST,
|
||||
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class BlacksmithNPCSettings implements TraitSettings<BlacksmithSetting> {
|
||||
|
||||
@Override
|
||||
public void changeValue(@NotNull BlacksmithSetting setting, @Nullable Object newValue) {
|
||||
if (setting.getValueType() == SettingValueType.STRING_LIST ||
|
||||
if (setting.getValueType() == SettingValueType.ENCHANTMENT_LIST ||
|
||||
setting.getValueType() == SettingValueType.REFORGE_ABLE_ITEMS) {
|
||||
//Workaround to make sure it's treated as the correct type
|
||||
currentValues.put(setting, newValue == null ? null : ConfigHelper.asStringList(newValue));
|
||||
|
@ -90,7 +90,7 @@ public enum BlacksmithSetting implements Setting {
|
||||
/**
|
||||
* The setting for the enchantments a blacksmith cannot apply to items
|
||||
*/
|
||||
ENCHANTMENT_BLOCK_LIST("enchantmentBlockList", SettingValueType.STRING_LIST, List.of("binding_curse",
|
||||
ENCHANTMENT_BLOCK_LIST("enchantmentBlockList", SettingValueType.ENCHANTMENT_LIST, List.of("binding_curse",
|
||||
"mending", "vanishing_curse"), "The enchantments a " +
|
||||
"blacksmith is denied from applying to an item. Disable anything you find too op or annoying.",
|
||||
true, false),
|
||||
@ -277,7 +277,7 @@ public enum BlacksmithSetting implements Setting {
|
||||
this.valueType = valueType;
|
||||
this.childPath = key;
|
||||
if (key.contains(".")) {
|
||||
String[] pathParts = path.split("\\.");
|
||||
String[] pathParts = key.split("\\.");
|
||||
this.commandName = pathParts[0];
|
||||
} else {
|
||||
this.commandName = key;
|
||||
|
@ -73,7 +73,7 @@ public class GlobalBlacksmithSettings implements Settings<BlacksmithSetting> {
|
||||
* @param newValue <p>The new value for the setting</p>
|
||||
*/
|
||||
public void changeValue(@NotNull BlacksmithSetting blacksmithSetting, @Nullable Object newValue) {
|
||||
if (blacksmithSetting.getValueType() == SettingValueType.STRING_LIST ||
|
||||
if (blacksmithSetting.getValueType() == SettingValueType.ENCHANTMENT_LIST ||
|
||||
blacksmithSetting.getValueType() == SettingValueType.REFORGE_ABLE_ITEMS) {
|
||||
//Workaround to make sure it's treated as the correct type
|
||||
this.settings.put(blacksmithSetting, newValue == null ? null : ConfigHelper.asStringList(newValue));
|
||||
|
@ -181,7 +181,7 @@ public enum ScrapperSetting implements Setting {
|
||||
* Which items are ignored when calculating salvage for a given material
|
||||
*/
|
||||
IGNORED_SALVAGE("ignoredSalvage", SettingValueType.STRING_LIST,
|
||||
new ArrayList<>(List.of("*_SHOVEL,*_PICKAXE,*_AXE,*_HOE,*_SWORD:STICK")),
|
||||
new ArrayList<>(List.of("*_SHOVEL;*_PICKAXE;*_AXE;*_HOE;*_SWORD:STICK")),
|
||||
"Items ignored during salvage calculation. This follows the format: " +
|
||||
"\"MATERIAL[,MATERIAL2][,MATERIAL3]:IGNORED\", so the material or materials listed will ignore " +
|
||||
"the material specified after the \":\" when calculating salvage (* matches any character). This " +
|
||||
@ -223,7 +223,7 @@ public enum ScrapperSetting implements Setting {
|
||||
this.valueType = valueType;
|
||||
this.childPath = key;
|
||||
if (key.contains(".")) {
|
||||
String[] pathParts = path.split("\\.");
|
||||
String[] pathParts = key.split("\\.");
|
||||
this.commandName = pathParts[0];
|
||||
} else {
|
||||
this.commandName = key;
|
||||
|
Reference in New Issue
Block a user