Getting UUID of class by Discordid

Hi, its me again,
I have trouble, Im making ClassAPI, and Idk how to get UUID of class by its DiscordID
CFG: Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
As always, thanks for help,
YTSkaGamerPL

Im going off memory. But its something like this

ConfigurationNode root; //the root node of the file
String discordId; //the discord id you wish to search for
ConfigurationNode classesNode = root.getNode("classes"); //the first child node
Optional<ConfigurationNode> opNode = classesNode.getChildrenList().stream().filter(c -> c.getNode("discordId").getString().equals(discordId)).findFirst();
//Above searches every class node and checks the discord id of that class, if it matches then it uses it
if(!opNode.isPresent()){
    //No discord id found
}
ConfigurationNode classNode = opNode.get();
String classId = (String)classNode.getKey();
1 Like

Not working - in my case its always null:

Right just tested it, it seems getChildrenList() doesn’t get the children of the node, but instead it gets the children nodes that are directly linked with actual values attached to them, due to yours having more nodes attached to them it does’t get returned.

swap that function out for this, it worked for me.

.getChildrenMap().values()

That gets all the direct children nodes, even if no actual value is attached to it