Prevent placeholder condition from pausing load, fixes #1795

This commit is contained in:
PikaMug 2021-09-21 14:44:35 -04:00
parent 3b3eedf56c
commit 75658b6399

View File

@ -3840,19 +3840,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
if (data.contains(conditionKey + "check-placeholder-id")) {
if (ConfigUtil.checkList(data.getList(conditionKey + "check-placeholder-id"), String.class)) {
if (data.contains(conditionKey + "check-placeholder-value")) {
if (ConfigUtil.checkList(data.getList(conditionKey + "check-placeholder-value"), String.class)) {
condition.setPlaceholdersCheckIdentifier((LinkedList<String>) data.getStringList(conditionKey
+ "check-placeholder-id"));
condition.setPlaceholdersCheckValue((LinkedList<String>) data.getStringList(conditionKey
+ "check-placeholder-value"));
} else {
throw new ConditionFormatException("check-placeholder-value is not a list of values", conditionKey);
}
}
final LinkedList<String> id = new LinkedList<>(data.getStringList(conditionKey
+ "check-placeholder-id"));
condition.setPlaceholdersCheckIdentifier(id);
} else {
throw new ConditionFormatException("check-placeholder-id is not a list of identifiers", conditionKey);
}
if (ConfigUtil.checkList(data.getList(conditionKey + "check-placeholder-value"), String.class)) {
final LinkedList<String> val = new LinkedList<>(data.getStringList(conditionKey
+ "check-placeholder-value"));
condition.setPlaceholdersCheckValue(val);
} else {
throw new ConditionFormatException("check-placeholder-value is not a list of values", conditionKey);
}
}
return condition;
}