Uh, I have a problem with your API.
Why not: dbManager.getConnection(plugin)?
Uh, I have a problem with your API.
Why not: dbManager.getConnection(plugin)?
So, you want me to create a connection object for you and request the plugin main class as a parameter? I can do that once Iām home.
Edit: Finished.
Looks good. I will perhaps softdepend this
(something is wrong with this sentence). But I recommend to make a new database for every plugin. Plugins may use flyaway, that needs an untouched database. Why not make the config like this:
username: '<username>'
password: '<password>'
url: '<url>'
databases:
superplugin: 'superplugindb'
Softdepend on
Now itās correct :3
Off-topic
@GameplayJDK I am aware of that, but since Java 8 isnāt globally supported yet, Iāll try to get the most out of Rhino (Rhino is a bit faster that the builtin JS engine)
Iām not too fluent with SnakeYAML so I donāt know how it handles nested values.
But trust me, as soon as Sponge is out, I will do it like that.
Update: You can now use the plugin object instead of the name. (Check GitHub)
Off-topic
@Exstar Possibly you could distribute the jar, for people who donāt have JRE8⦠Iām not familiar with the distribution rules 
Iām working on a MySQLManager class.
All connections will be set up by DBManager, youāll be able to use the DBManager.getConnection(plugin) method to get the connection you need.
Version 1.2_0 available for download!
Made a logo. Do you like it? :3
Maybe,whatās in it for me?
It would be better to have a āsharedā library that you can embed in your plugin, instead of a separate plugin.
Also, you can register your db as a service.
Iāll probably change that on a future date.
Some additions:
How adding a service will work:
//arguments: service class, service instance, replaceable, owner
ServiceManager.setProvider(DBManager.getClass(), dBManagerInstance, true, dbManagerPlugin)
Right now there is no way to get the ServiceManager from Game, but itās much better than DBManager.getInstance();.
You probably want to shoot me a PR. 
Not that I couldnāt do it on my own, but⦠meh.
Awesome! 
With permission of the author I added it to my maven repo:
<repository>
<id>thomas15v-repo</id>
<url>http://repo.thomas15v.net/plugins</url>
</repository>
<dependency>
<groupId>de.mrmysteri0us</groupId>
<artifactId>DBManager</artifactId>
<version>1.2</version>
</dependency>
And yeah I messed up the ci build a bit xD. If the server crashes (what sometimes happens if a sponge build triggers). Shoot me a PM.
Sorry for a stupid question but what is plugin in String database = dbManager.getDatabase(plugin);? Iām assuming itās a string of the plugin name?
Edit: Answer below.