While debugging 1 of my projects using the if statement below, it fails the first time, but can find my UUID the 2nd time. I can confirm that my file remains unchanged both times. What could be the cause of this?
Code:
if (PlayerDataManager.getInstance().getConfig().getChildrenMap().keySet().contains(player.getUniqueId()))
System.out.println("I found " + player.getName());
else
System.out.println("I couldn't find " + player.getName());
I use PlayerDataManager.getInstance().getConfig() which refers to the private CommentedConfigurationNode.
I somehow fixed it 5 minutes ago however. Turns out the UUID would be saved as a String for the first time, but for some reason change into an actual UUID the 2nd time. I don’t know why it’d do that as I never set it in the config as a String, but I did some checks to see whether or not I’m dealing with the String-based UUID or UUID itself.