If you thought this was going to be something from Jak and Daxter, I apologize, DarkEco stands for DarkSun159's Economy. I made Economy as a simple and fast alternative to other economies, such as a very popular iConomy. I was trying to get an economy plugin to work, but...let's just say stuff went screwy...So, I made this simple alternative. My goals while making this were: 1). Be easy and simple for me to use, adn 2). Be easy and simple for others to use. So with DarkEco, I am sure I accomplished both of these tasks. Now then, enough mincing my words, and on to how to use it.
FIRST You must list DarkEco as a dependency. To do so, just add this line to your plugin.yml file
SECOND Next, you have to add the DarkEco to your build path. In Eclipse, it would be:
- Right click on project
- Go to "Build Path"
- Go to "Configure Build Path"
- Go to the "Libraries" tab
- Click "Add external libraries"
- Go to your plugins folder.
- Select "DarkEco.java"
- Click "Done"
That simple! (Just remember, DarkEco is actually a plugin to do automatic saving, so download it and remember to put it in your plugins folder!)
- LAST Use the awesome library in your code! There are only a few methods you need to remember, and they are all static, so you needn't make an intance of the object! Here are some functions:
All of the functions for DarkEco.java are contained in the static class, "DarkEco". 1). Get Players Balance using DarkEco.getBalance(playerInstance) will return the playerInstance's amount of money. 2). Add money to players account using DarkEco.add(playerInstance, amountOfMoney) you will add amountOfMoney to playerInstance's account. 3). Remove money from players account using DarkEco.remove(playerInstance, amountOfMoney) you guessed it...it will remove amountOfMoney from playerInstances account. 4). Set a players balance using DarkEco.set(playerInstance, amountOfMoney) you will set playerInstance's account to ammountOfMoney.
My plugin is just that simple. No setup functions to get economy going, no creating instances of the economy and passing it to everything that needs it, DarkEco simplifies it all!
- Automatically saves when the server is shutdown or the plugins are reloaded.
- Automatically creates accounts for new players(starting at $0.00)