Fixes a bug in the preset prefix logic
	
		
			
	
		
	
	
		
	
		
			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:
		@@ -85,7 +85,8 @@ public class GlobalSettings {
 | 
			
		||||
     * @param newValue   <p>The new value for the setting</p>
 | 
			
		||||
     */
 | 
			
		||||
    public void changeValue(NPCSetting npcSetting, Object newValue) {
 | 
			
		||||
        if (npcSetting.getValueType() == SettingValueType.STRING_LIST) {
 | 
			
		||||
        if (npcSetting.getValueType() == SettingValueType.STRING_LIST ||
 | 
			
		||||
                npcSetting.getValueType() == SettingValueType.REFORGE_ABLE_ITEMS) {
 | 
			
		||||
            //Workaround to make sure it's treated as the correct type
 | 
			
		||||
            defaultNPCSettings.put(npcSetting, newValue == null ? null : ConfigHelper.asStringList(newValue));
 | 
			
		||||
        } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,8 @@ public class NPCSettings {
 | 
			
		||||
     * @param newValue <p>The new value of the setting</p>
 | 
			
		||||
     */
 | 
			
		||||
    public void changeSetting(NPCSetting setting, Object newValue) {
 | 
			
		||||
        if (setting.getValueType() == SettingValueType.STRING_LIST) {
 | 
			
		||||
        if (setting.getValueType() == SettingValueType.STRING_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));
 | 
			
		||||
        } else {
 | 
			
		||||
@@ -371,8 +372,11 @@ public class NPCSettings {
 | 
			
		||||
     * @return <p>The value with placeholders replaced</p>
 | 
			
		||||
     */
 | 
			
		||||
    private static List<String> replaceReforgeAblePresets(List<String> stringList) {
 | 
			
		||||
        List<String> newStrings = new ArrayList<>(stringList);
 | 
			
		||||
        List<String> newStrings = new ArrayList<>();
 | 
			
		||||
        for (String item : stringList) {
 | 
			
		||||
            if (item == null) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            String replaced = SmithPreset.replacePreset(item);
 | 
			
		||||
            if (!replaced.equals(item)) {
 | 
			
		||||
                newStrings.addAll(List.of(replaced.split(",")));
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,8 @@ public enum SmithPreset {
 | 
			
		||||
            negated = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ((negated && !upperCasedPreset.startsWith("_PRESET:")) && !upperCasedPreset.startsWith("PRESET:")) {
 | 
			
		||||
        if ((negated && !upperCasedPreset.startsWith("_PRESET:")) ||
 | 
			
		||||
                (!negated && !upperCasedPreset.startsWith("PRESET:"))) {
 | 
			
		||||
            return possiblePreset;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user