diff --git a/pom.xml b/pom.xml
index 471f420fa..993911b1a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -106,6 +106,14 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+ reserve-repo
+ https://dl.bintray.com/theneweconomy/java/
+
+
+ vault-repo
+ http://nexus.hc.to/content/repositories/pub_releases
+
sk89q-repo
http://maven.sk89q.com/repo/
@@ -140,8 +148,25 @@
net.milkbowl.vault
VaultAPI
1.6
- system
- ${basedir}/lib/Vault 1.7.9.jar
+ provided
+
+
+ org.bukkit
+ bukkit
+
+
+
+
+ net.tnemc
+ Reserve
+ 0.1.0.12
+ compile
+
+
+ com.github
+ TNELib
+
+
com.lishid
diff --git a/src/main/java/org/maxgamer/quickshop/Economy/Economy_Reserve.java b/src/main/java/org/maxgamer/quickshop/Economy/Economy_Reserve.java
new file mode 100644
index 000000000..796ce4e16
--- /dev/null
+++ b/src/main/java/org/maxgamer/quickshop/Economy/Economy_Reserve.java
@@ -0,0 +1,100 @@
+package org.maxgamer.quickshop.Economy;
+
+import net.tnemc.core.Reserve;
+import net.tnemc.core.economy.EconomyAPI;
+import org.bukkit.Bukkit;
+
+import java.math.BigDecimal;
+import java.util.UUID;
+
+/**
+ * @author creatorfromhell
+ */
+public class Economy_Reserve implements EconomyCore {
+
+ private EconomyAPI reserve = null;
+
+ public Economy_Reserve() {
+ setup();
+ }
+
+ private void setup() {
+ if(((Reserve)Bukkit.getPluginManager().getPlugin("Reserve")).economyProvided()) {
+ reserve = ((Reserve)Bukkit.getPluginManager().getPlugin("Reserve")).economy();
+ }
+ }
+
+ /**
+ * Checks that this economy is valid. Returns false if it is not valid.
+ *
+ * @return True if this economy will work, false if it will not.
+ */
+ @Override
+ public boolean isValid() {
+ return reserve != null;
+ }
+
+ /**
+ * Formats the given number... E.g. 50.5 becomes $50.5 Dollars, or 50 Dollars 5 Cents
+ *
+ * @param balance The given number
+ *
+ * @return The balance in human readable text.
+ */
+ @Override
+ public String format(double balance) {
+ return reserve.format(new BigDecimal(balance));
+ }
+
+ /**
+ * Deposits a given amount of money from thin air to the given username.
+ *
+ * @param name The exact (case insensitive) username to give money to
+ * @param amount The amount to give them
+ *
+ * @return True if success (Should be almost always)
+ */
+ @Override
+ public boolean deposit(UUID name, double amount) {
+ return reserve.addHoldings(name, new BigDecimal(amount));
+ }
+
+ /**
+ * Withdraws a given amount of money from the given username and turns it to thin air.
+ *
+ * @param name The exact (case insensitive) username to take money from
+ * @param amount The amount to take from them
+ *
+ * @return True if success, false if they didn't have enough cash
+ */
+ @Override
+ public boolean withdraw(UUID name, double amount) {
+ return reserve.removeHoldings(name, new BigDecimal(amount));
+ }
+
+ /**
+ * Transfers the given amount of money from Player1 to Player2
+ *
+ * @param from The player who is paying money
+ * @param to The player who is receiving money
+ * @param amount The amount to transfer
+ *
+ * @return true if success (Payer had enough cash, receiver was able to receive the funds)
+ */
+ @Override
+ public boolean transfer(UUID from, UUID to, double amount) {
+ return reserve.transferHoldings(from, to, new BigDecimal(amount));
+ }
+
+ /**
+ * Fetches the balance of the given account name
+ *
+ * @param name The name of the account
+ *
+ * @return Their current balance.
+ */
+ @Override
+ public double getBalance(UUID name) {
+ return reserve.getHoldings(name).doubleValue();
+ }
+}
diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java
index 0acdb18c3..351b9a5f1 100644
--- a/src/main/java/org/maxgamer/quickshop/QuickShop.java
+++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java
@@ -1,35 +1,62 @@
package org.maxgamer.quickshop;
-import java.io.File;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.util.*;
-import java.util.Map.Entry;
-
-import lombok.*;
+import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
-import org.jetbrains.annotations.*;
+import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.Command.QS;
import org.maxgamer.quickshop.Command.Tab;
-import org.maxgamer.quickshop.Database.*;
+import org.maxgamer.quickshop.Database.Database;
import org.maxgamer.quickshop.Database.Database.ConnectionException;
+import org.maxgamer.quickshop.Database.DatabaseCore;
+import org.maxgamer.quickshop.Database.DatabaseHelper;
+import org.maxgamer.quickshop.Database.DatabaseManager;
+import org.maxgamer.quickshop.Database.MySQLCore;
+import org.maxgamer.quickshop.Database.SQLiteCore;
import org.maxgamer.quickshop.Economy.Economy;
import org.maxgamer.quickshop.Economy.EconomyCore;
+import org.maxgamer.quickshop.Economy.Economy_Reserve;
import org.maxgamer.quickshop.Economy.Economy_Vault;
-import org.maxgamer.quickshop.Listeners.*;
+import org.maxgamer.quickshop.Listeners.BlockListener;
+import org.maxgamer.quickshop.Listeners.ChatListener;
+import org.maxgamer.quickshop.Listeners.ChunkListener;
+import org.maxgamer.quickshop.Listeners.CustomInventoryListener;
+import org.maxgamer.quickshop.Listeners.DisplayBugFixListener;
+import org.maxgamer.quickshop.Listeners.DisplayProtectionListener;
+import org.maxgamer.quickshop.Listeners.LockListener;
+import org.maxgamer.quickshop.Listeners.PlayerListener;
+import org.maxgamer.quickshop.Listeners.WorldListener;
import org.maxgamer.quickshop.Shop.Shop;
import org.maxgamer.quickshop.Shop.ShopLoader;
import org.maxgamer.quickshop.Shop.ShopManager;
-import org.maxgamer.quickshop.Util.*;
+import org.maxgamer.quickshop.Util.Compatibility;
+import org.maxgamer.quickshop.Util.IncompatibleChecker;
+import org.maxgamer.quickshop.Util.ItemMatcher;
+import org.maxgamer.quickshop.Util.MsgUtil;
+import org.maxgamer.quickshop.Util.PermissionChecker;
+import org.maxgamer.quickshop.Util.SentryErrorReporter;
import org.maxgamer.quickshop.Util.Timer;
+import org.maxgamer.quickshop.Util.Util;
import org.maxgamer.quickshop.Watcher.LogWatcher;
import org.maxgamer.quickshop.Watcher.UpdateWatcher;
+import java.io.File;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.UUID;
+
//import com.griefcraft.lwc.LWCPlugin;
@Getter
public class QuickShop extends JavaPlugin {
@@ -759,6 +786,14 @@ public class QuickShop extends JavaPlugin {
private boolean loadEcon() {
try {
EconomyCore core = new Economy_Vault();
+
+ if(Bukkit.getPluginManager().isPluginEnabled("Reserve")) {
+ final EconomyCore reserveCore = new Economy_Reserve();
+ if(reserveCore.isValid()) {
+ core = reserveCore;
+ }
+ }
+
if (!core.isValid()) {
// getLogger().severe("Economy is not valid!");
getLogger().severe("QuickShop could not hook into an economy plugin/Not found Vault!");