Hi, I am having problems reading a list from the configuration. This is my conf file:
interactions {
example1=[
{
questions=[
"How do i get money?"
"Does anyone know how to get money?"
"I need money"
]
answers=[
"{player} you have to sell in the store"
"{player} sell items"
]
}
]
example2=[
{
questions=[
"I want to buy a block in the store"
"I want to go to the store"
"where do I get blocks"
]
answers=[
"{player} type /shop"
"{player} to buy items type /shop"
]
}
]
}
And when I try to read what is inside “questions” or “answers” I always get an empty list.
This is the code I am using:
List<String> questions = main.config.node("interactions", key, "questions").childrenList().stream().map(ConfigurationNode::getString).collect(Collectors.toList());
List<String> answers = main.config.node("interactions", key, "answers").childrenList().stream().map(ConfigurationNode::getString).collect(Collectors.toList());
What am I doing wrong? Thanks for reading