How to get ConfigDir from main class and make next config file and managing script

But plz, dont send me to Sponde docs, Ive read them and try to do same examples but all my tries failed. Please give me script what will contain: getter Config dir, and config implementor (loader, node & file creator)

If you send your attempts over we can look over them and tell you if we spot something missing, that way you still learn and use ‘your’ code. Just so you know you can type code into here using 4 spaces

Its what I want
(Extrenal class)

public void getConfigDir()
{}

public void manageConfig(File f, Object value, Object… node)
{
ConfLoader = Hocon[…].builder();
ConNode node = loader.load();
//here I want to manage config with nodes
}

If you don’t know how to pass objects between classes, it is recommended that you learn Java before attempting to learn Sponge. At the very least you must learn enough to the point where you can distinguish between basic Java questions and Sponge-specific questions, so that the former can go somewhere that isn’t here.

1 Like

I know Java very well, but 1st - Im comming from Bukkit. 2nd - I have in Main class getter with GetConfigDir() but Id dont work for unknown reason. Propably this returns NullPointerException in my Config manager

If something is null, that is because you did not assign a value to it

Based on your “source code”. It seems like you want something like the YAMLConfiguration from Bukkit? Where you load a File in such as

File file;
YAMLConfiguration.loadConfiguration(file);

Is that what you want? It also seems like your guessing on errors saying “probably this returns NullpointerException” instead of … Actually knowing the error?

Anyway if you wish for that code, i have a wrapper to Ninja Config, something very similar to YAMLConfiguration from Bukkit.

Edit:
This is the sourcecode from it.