From 310df669d19717a4aa7f815b0fef14b4e27182ac Mon Sep 17 00:00:00 2001 From: Sleaker Date: Sun, 27 Nov 2011 11:14:28 -0800 Subject: [PATCH] added MineConomy support --- lib/MineConomy.jar | Bin 0 -> 15382 bytes src/net/milkbowl/vault/Vault.java | 10 +- .../economy/plugins/Economy_MineConomy.java | 156 ++++++++++++++++++ 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 lib/MineConomy.jar create mode 100644 src/net/milkbowl/vault/economy/plugins/Economy_MineConomy.java diff --git a/lib/MineConomy.jar b/lib/MineConomy.jar new file mode 100644 index 0000000000000000000000000000000000000000..2a2656763ad602d8443e28b0183509ef579d6f92 GIT binary patch literal 15382 zcma*O1ymi&(l(4c!QC~uySrO(hmG6Doj~y5Zow_MySqbh3ldy|dw{@C?z!hC?{|}P z|7OkXS*)q2Yig#etLy1fk_CrA2l>%%(t(2iy7>1A{N)#D%Bb|m8{q%C0cd4sV{7U7 z4>w}|-y4CJwx-5*wst^||H#0AAesUN=W&rmnqIn1g9ZVi{G*Jpv9XQ5`eY#~QXKE0`fUXE=Ui(Thxf8;EY>@J%u?aG>lNZ*;W z#(T`Tk7bVE;j1$6 z;Xdh@O?@Y-%elol|FHR#T8`GJ^_yuc&8bO8xUtl_4YJL>EBo`T)7R-s;AbgAtF*~qI30MVA2J_>Zbx1VZpzrpmQx$ zwCtE>JINT5x3u5v?}e2;G<==h^PF3X&8(@+(=B-FR%f^&N**kj<<~H*b5=g!JEw-aJ9inaNAn;^4oLuMzg^eHOnI|*qNu3o#cMGI%%vgXn-8dZY*a3;#9^t9k zD`udv-!?~YyoSd1;BJj}+BsSw95*+=u|Id)Us`s&)zLrbCNDVCN-<)|#x}kJ3ucOX zqiZ5Z!f@_IA;mwFyC;BSk+pm4*u|zG7A7Z(?u21^y%&OTP7fe*S1b?Dsq%Nd<~M_9 z{%99<57$!sfrlb>DFSD?_Yq!&x68%FRpn@7o+t$4N-qv^ol^2n$uTa}&svUsA|5gY z|B8CW&?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zO#`d6`EVz^%s jeix_xL?C7PHEL6mg?vd>fPi4X{As>qGK+qsGC}@74MKk- literal 0 HcmV?d00001 diff --git a/src/net/milkbowl/vault/Vault.java b/src/net/milkbowl/vault/Vault.java index 18d9c11..11a24f5 100644 --- a/src/net/milkbowl/vault/Vault.java +++ b/src/net/milkbowl/vault/Vault.java @@ -34,6 +34,7 @@ import net.milkbowl.vault.economy.plugins.Economy_3co; import net.milkbowl.vault.economy.plugins.Economy_BOSE6; import net.milkbowl.vault.economy.plugins.Economy_BOSE7; import net.milkbowl.vault.economy.plugins.Economy_Essentials; +import net.milkbowl.vault.economy.plugins.Economy_MineConomy; import net.milkbowl.vault.economy.plugins.Economy_MultiCurrency; import net.milkbowl.vault.economy.plugins.Economy_iConomy4; import net.milkbowl.vault.economy.plugins.Economy_iConomy5; @@ -136,7 +137,14 @@ public class Vault extends JavaPlugin { getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] MultiCurrency found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); } - + + //Try Loading MineConomy + if (packageExists(new String[] { "me.mjolnir.mineconomy.MineConomy" })) { + Economy econ = new Economy_MineConomy(this); + getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); + log.info(String.format("[%s][Economy] MineConomy found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); + + } // Try to load 3co if (packageExists(new String[] { "me.ic3d.eco.ECO" })) { Economy econ = new Economy_3co(this); diff --git a/src/net/milkbowl/vault/economy/plugins/Economy_MineConomy.java b/src/net/milkbowl/vault/economy/plugins/Economy_MineConomy.java new file mode 100644 index 0000000..f09a1da --- /dev/null +++ b/src/net/milkbowl/vault/economy/plugins/Economy_MineConomy.java @@ -0,0 +1,156 @@ +package net.milkbowl.vault.economy.plugins; + +import java.util.logging.Logger; + +import me.mjolnir.mineconomy.Accounting; +import me.mjolnir.mineconomy.MineConomy; + +import org.bukkit.event.Event.Priority; +import org.bukkit.event.Event.Type; +import org.bukkit.event.server.PluginDisableEvent; +import org.bukkit.event.server.PluginEnableEvent; +import org.bukkit.event.server.ServerListener; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; + +import net.milkbowl.vault.economy.Economy; +import net.milkbowl.vault.economy.EconomyResponse; +import net.milkbowl.vault.economy.EconomyResponse.ResponseType; + +public class Economy_MineConomy implements Economy { + private static final Logger log = Logger.getLogger("Minecraft"); + + private String name = "MineConomy"; + private Plugin plugin = null; + private PluginManager pluginManager = null; + private MineConomy econ = null; + private EconomyServerListener economyServerListener = null; + + public Economy_MineConomy(Plugin plugin) { + this.plugin = plugin; + pluginManager = this.plugin.getServer().getPluginManager(); + + economyServerListener = new EconomyServerListener(this); + + this.pluginManager.registerEvent(Type.PLUGIN_ENABLE, economyServerListener, Priority.Monitor, plugin); + this.pluginManager.registerEvent(Type.PLUGIN_DISABLE, economyServerListener, Priority.Monitor, plugin); + + // Load Plugin in case it was loaded before + if (econ == null) { + Plugin econ = plugin.getServer().getPluginManager().getPlugin("MineConomy"); + if (econ != null && econ.isEnabled()) { + this.econ = (MineConomy) econ; + log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name)); + } + } + } + + private class EconomyServerListener extends ServerListener { + Economy_MineConomy economy = null; + + public EconomyServerListener(Economy_MineConomy economy) { + this.economy = economy; + } + + public void onPluginEnable(PluginEnableEvent event) { + if (economy.econ == null) { + Plugin eco = plugin.getServer().getPluginManager().getPlugin("MineConomy"); + + if (eco != null && eco.isEnabled()) { + economy.econ = (MineConomy) eco; + log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name)); + } + } + } + + public void onPluginDisable(PluginDisableEvent event) { + if (economy.econ != null) { + if (event.getPlugin().getDescription().getName().equals("MineConomy")) { + economy.econ = null; + log.info(String.format("[%s][Economy] %s unhooked.", plugin.getDescription().getName(), economy.name)); + } + } + } + } + + @Override + public boolean isEnabled() { + return this.econ != null; + } + + @Override + public String getName() { + return name; + } + + @Override + public String format(double amount) { + return String.valueOf(amount); + } + + @Override + public double getBalance(String playerName) { + return Accounting.getBalance(playerName, MineConomy.accounts); + } + + @Override + public boolean has(String playerName, double amount) { + return getBalance(playerName) >= amount; + } + + @Override + public EconomyResponse withdrawPlayer(String playerName, double amount) { + double balance = getBalance(playerName); + if (amount < 0) { + return new EconomyResponse(0, balance, ResponseType.FAILURE, "Cannot withdraw negative funds"); + } else if (balance >= amount) { + double finalBalance = balance - amount; + Accounting.write(playerName, finalBalance, MineConomy.accounts); + return new EconomyResponse(amount, finalBalance, ResponseType.SUCCESS, null); + } else { + return new EconomyResponse(0, balance, ResponseType.FAILURE, "Insufficient funds"); + } + } + + @Override + public EconomyResponse depositPlayer(String playerName, double amount) { + double balance = getBalance(playerName); + if (amount < 0) { + return new EconomyResponse(0, balance, ResponseType.FAILURE, "Cannot deposit negative funds"); + } else { + balance += amount; + Accounting.write(playerName, balance, MineConomy.accounts); + return new EconomyResponse(amount, balance, ResponseType.SUCCESS, null); + } + } + + @Override + public EconomyResponse createBank(String name, String player) { + return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!"); + } + + @Override + public EconomyResponse bankHas(String name, double amount) { + return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!"); + } + + @Override + public EconomyResponse bankWithdraw(String name, double amount) { + return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!"); + } + + @Override + public EconomyResponse bankDeposit(String name, double amount) { + return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!"); + } + + @Override + public EconomyResponse isBankOwner(String name, String playerName) { + return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!"); + } + + @Override + public EconomyResponse isBankMember(String name, String playerName) { + return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!"); + } +}