Home›Java›Mods›MoneySQL (bungee money sync)
ModsJava

MoneySQL (bungee money sync)

Minecraft Java mod. Download on the author's site.

⬇ Download on Spigot
MoneySQL is a simple plugin to sync your players money with MySQL database and other servers. Its fast, easy, powerfull, configurable and simple. Works with all economy plugins. It supports UUID and works on 1.7 and 1.8 Minecraft versions.​

Commands and permissions
Spoiler
[​IMG]​

Installation
Spoiler
1. Download plugin and put it into your plugins folder.
2. If you not have, download and install Vault.
3. If you not have, download and install any economy plugin which is supported by Vault, for example IConomy.
4. Go to config.yml and configure your MySQL connection, optionally other things ( Event list).
5. Done!

PHP script for website
Spoiler
[​IMG]

Download [v5]: http://dev.bukkit.org/paste/10665/

Server Requirements:
  • Newest PHP version.
  • Newest MySQL server version.
  • Be sure your PHP supports mysqli.

Developers API
Spoiler
Using API you can:

  • Listen to MoneySQLUpdateEvent which is called when updating players money
  • Check reason of updating using CausedBy enumeration (EVENT, PLUGIN_DISABLE, COMMAND, AUTO_SCHEDULER, OTHER)
  • Use powerfull mr.wruczek.moneysql.Methods class (you can get: player UUID, player money, check if event from configuration is enabled, and get numerous of asynchronous and non-asynchronous updating methods)
  • Check information about database, execute sql and more
    • mr.wruczek.moneysql.data.MySQLManager - methods which MoneySQL are using (creating player in database ect.).
    • mr.wruczek.moneysql.data.MoneySQLManager - mysql variable - everything about MySQL (executing query, opening and closing connection ect.)
  • Get configuration variables: mr.wruczek.moneysql.ConfigManager
Examples

Click here for version with Syntax Highliting and more readable code

Basics:

Code (Text):
// Our player
Player player = Bukkit.getPlayer("Wruczek");

// Get his UUID
Methods.getUUID(player);

// Getting his money
Methods.getPlayerMoney(player);

// Using string with name
Methods.getPlayerMoney("Wruczek");

// Check if event from configuration is enabled
Methods.isEventEnabled("PlayerJoinEvent");

// Update player (easiest way)
Methods.update(player);

// Update player (lets set CausedBy and get response)
Methods.update(player, CausedBy.COMMAND, new Runnable() {
@Override
public void run() {
System.out.println("Done updating");
}
});

// Get MySQL host name from config
ConfigManager.mysql_host;

// Get list of events
ConfigManager.update_events;

// Lets execute query
MySQLManager.mysql.updateSQL("UPDATE moneysql SET money=100 WHERE last_known_name=\"Wruczek\"");

// Lets execute query, but this time we want to get ResultSet
ResultSet rs = MySQLManager.mysql.querySQL("SELECT * FROM moneysql");
Examples with events:

Code (Text):
// Lets inform about working PlayerJoinEvent
@EventHandler
public void join(PlayerJoinEvent event) {
if(Methods.isEventEnabled("PlayerJoinEvent")) {
System.out.println("You enabled updating player money when player join...");
System.out.println("Updating player " + event.getPlayer().getName() + "...");
}
}

// Lets use our custom event
@EventHandler
public void onMoneySQLUpdate(MoneySQLUpdateEvent event) {
// Lets make that player Wruczek will never be updated by command /moneysql update...
if(event.getPlayer().getName().equals("Wruczek") && event.getCausedBy() == CausedBy.COMMAND) {
event.setCancelled(true);
}
}

Donate
I'm using a lot of my personal time for this plugin. If you like this plugin please donate to support development

[​IMG]



Please rate 5 starts if you like this plugin, it helps me a lot. Thank you!
​
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

MoneySQL (bungee money sync) is a free Minecraft Java mod. Downloaded 966 times (via Spigot). Download it and open it directly in the game.

Explore more