V1.6.7 Release. Support for BagOgGold added to Vault.

https://dev.bukkit.org/projects/bagofgold
This commit is contained in:
Rocologo 2017-11-03 22:23:16 +01:00
parent fbb9ce69ac
commit 4f98a611d6
6 changed files with 244 additions and 5 deletions

View File

@ -78,6 +78,7 @@ Github and we'll get to it at our convenience.
* Economy
- 3co (http://forums.bukkit.org/threads/22461/)
- AEco
- BagOfGold
- BOSEconomy 6 (http://forums.bukkit.org/threads/19025/)
- BOSEconomy 7
- CommandsEX Economy (http://dev.bukkit.org/server-mods/commandsex/)

BIN
lib/BagOfGold-0.5.0.jar Normal file

Binary file not shown.

BIN
lib/DroxPerms-0.5.1.jar Normal file

Binary file not shown.

23
pom.xml
View File

@ -12,12 +12,12 @@
<!-- Project information -->
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>${api.version}.6</version>
<version>${api.version}.7</version>
<name>Vault</name>
<url>http://dev.bukkit.org/server-mods/vault/</url>
<description>Vault is a Permissions &amp; Economy API to allow plugins to more easily hook into these systems without needing to hook each individual system themselves.
Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms, bPerms2, SimplyPerms, DroxPerms, zPermissions, rscPermissions, KPerms, Starburst, iConomy (4/5/6) BOSEconomy *6/7), EssentialsEcon, 3Co, MultiConomy, MineConomy, EconXP, eWallet, CurrencyCore, XPBank, CraftConomy, AEco, SDFEconomy, TAEcon, and OverPermissions</description>
Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms, bPerms2, SimplyPerms, DroxPerms, zPermissions, rscPermissions, KPerms, Starburst, iConomy (4/5/6) BOSEconomy *6/7), EssentialsEcon, 3Co, MultiConomy, MineConomy, EconXP, eWallet, CurrencyCore, XPBank, CraftConomy, AEco, SDFEconomy, TAEcon, BagOfGold and OverPermissions</description>
@ -73,6 +73,11 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<id>escapecraft-repo</id>
<url>http://dev.escapecraft.com/maven</url>
</repository>
<!-- Used for BagOfGold / MobHunting -->
<repository>
<id>fractal</id>
<url>https://fractal.lindegaard.one:8187/artifactory/plugins-release/</url>
</repository>
</repositories>
<dependencies>
@ -97,8 +102,10 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<dependency>
<groupId>de.hydrox.bukkit</groupId>
<artifactId>DroxPerms</artifactId>
<version>0.5.0</version>
<version>0.5.1</version>
<optional>true</optional>
<scope>system</scope>
<systemPath>${project.basedir}/lib/DroxPerms-0.5.1.jar</systemPath>
</dependency>
<dependency>
<groupId>me.coniin.plugins.minefaconomy</groupId>
@ -410,6 +417,14 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<scope>system</scope>
<systemPath>${project.basedir}/lib/overpermissions-2.0.0.jar</systemPath>
</dependency>
<dependency>
<groupId>one.lindegaard</groupId>
<artifactId>BagOfGold</artifactId>
<version>0.5.0</version>
<optional>true</optional>
<scope>system</scope>
<systemPath>${project.basedir}/lib/BagOfGold-0.5.0.jar</systemPath>
</dependency>
</dependencies>
<build>
@ -437,7 +452,7 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>2.4</version>
<configuration>
<artifactSet>
<includes>

View File

@ -40,6 +40,7 @@ import net.milkbowl.vault.chat.plugins.Chat_mChatSuite;
import net.milkbowl.vault.chat.plugins.Chat_rscPermissions;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.plugins.Economy_BOSE7;
import net.milkbowl.vault.economy.plugins.Economy_BagOfGold;
import net.milkbowl.vault.economy.plugins.Economy_CommandsEX;
import net.milkbowl.vault.economy.plugins.Economy_Craftconomy3;
import net.milkbowl.vault.economy.plugins.Economy_CurrencyCore;
@ -242,6 +243,10 @@ public class Vault extends JavaPlugin {
* Attempts to load Economy Addons
*/
private void loadEconomy() {
// Try to load BagOfGold/MobHunting
hookEconomy("BagOfGold", Economy_BagOfGold.class, ServicePriority.Normal, "one.lindegaard.BagOfGold.BagOfGoldEconomy");
// Try to load MiConomy
hookEconomy("MiConomy", Economy_MiConomy.class, ServicePriority.Normal, "com.gmail.bleedobsidian.miconomy.Main");
@ -471,7 +476,7 @@ public class Vault extends JavaPlugin {
}
}
sender.sendMessage("Converson complete, please verify the data before using it.");
sender.sendMessage("Conversion complete, please verify the data before using it.");
}
private void infoCommand(CommandSender sender) {

View File

@ -0,0 +1,218 @@
package net.milkbowl.vault.economy.plugins;
import java.util.List;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.plugin.Plugin;
import net.milkbowl.vault.economy.AbstractEconomy;
import net.milkbowl.vault.economy.EconomyResponse;
import one.lindegaard.BagOfGold.BagOfGold;
import one.lindegaard.BagOfGold.BagOfGoldEconomy;
public class Economy_BagOfGold extends AbstractEconomy {
private static final Logger log = Logger.getLogger("Minecraft");
private String name = "BagOfGold";
private Plugin plugin = null;
protected BagOfGoldEconomy economy = null;
public Economy_BagOfGold(Plugin plugin) {
this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin);
// Load Plugin in case it was not loaded before
if (economy == null) {
BagOfGold bagofgold = (BagOfGold) plugin.getServer().getPluginManager().getPlugin("BagOfGold");
if (bagofgold != null && bagofgold.isEnabled()) {
economy = new BagOfGoldEconomy((BagOfGold) plugin);
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
}
}
}
@Override
public boolean isEnabled() {
if (economy == null) {
return false;
} else {
return ((Plugin) economy).isEnabled();
}
}
@Override
public String getName() {
return name;
}
@Override
public String format(double amount) {
return economy.format(amount);
}
@Override
public String currencyNamePlural() {
return economy.currencyNamePlural();
}
@Override
public String currencyNameSingular() {
return economy.currencyNameSingular();
}
@Override
public int fractionalDigits() {
return economy.fractionalDigits();
}
@Override
public boolean createPlayerAccount(String playername) {
return economy.createPlayerAccount(playername);
}
@Override
public boolean createPlayerAccount(String playername, String world) {
return economy.createPlayerAccount(playername, playername);
}
@Override
public double getBalance(String playername) {
return economy.getBalance(playername);
}
@Override
public double getBalance(String playername, String world) {
return economy.getBalance(playername, world);
}
@Override
public boolean has(String playername, double amount) {
return economy.has(playername, amount);
}
@Override
public boolean has(String playername, String world, double amount) {
return economy.has(playername, world, amount);
}
@Override
public EconomyResponse depositPlayer(String playername, double amount) {
return economy.depositPlayer(playername, amount);
}
@Override
public EconomyResponse depositPlayer(String playername, String world, double amount) {
return economy.depositPlayer(playername, world, amount);
}
@Override
public boolean hasBankSupport() {
return economy.hasBankSupport();
}
@Override
public List<String> getBanks() {
return economy.getBanks();
}
@Override
public EconomyResponse createBank(String account, String playername) {
return economy.createBank(account, playername);
}
@Override
public EconomyResponse deleteBank(String account) {
return economy.deleteBank(account);
}
@Override
public EconomyResponse bankHas(String account, double amount) {
return economy.bankHas(account, amount);
}
@Override
public boolean hasAccount(String playername) {
return economy.hasAccount(playername);
}
@Override
public boolean hasAccount(String playername, String world) {
return economy.hasAccount(playername, world);
}
@Override
public EconomyResponse bankBalance(String playername) {
return economy.bankBalance(playername);
}
@Override
public EconomyResponse isBankOwner(String account, String playername) {
return economy.isBankOwner(account, playername);
}
@Override
public EconomyResponse isBankMember(String account, String playername) {
return economy.isBankMember(account, playername);
}
@SuppressWarnings("deprecation")
@Override
public EconomyResponse withdrawPlayer(String playername, double amount) {
return economy.withdrawPlayer(playername, amount);
}
@SuppressWarnings("deprecation")
@Override
public EconomyResponse withdrawPlayer(String playername, String world, double amount) {
return economy.withdrawPlayer(playername, world, amount);
}
@Override
public EconomyResponse bankDeposit(String playername, double world) {
return economy.bankDeposit(playername, world);
}
@Override
public EconomyResponse bankWithdraw(String playername, double amount) {
return economy.bankWithdraw(playername, amount);
}
public class EconomyServerListener implements Listener {
Economy_BagOfGold economy = null;
public EconomyServerListener(Economy_BagOfGold economy) {
this.economy = economy;
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
Plugin eco = event.getPlugin();
if (eco.getDescription().getName().equals("BagOfGold")) {
if (economy.economy == null) {
BagOfGold bagofgold = (BagOfGold) plugin.getServer().getPluginManager().getPlugin("BagOfGold");
economy.economy = new BagOfGoldEconomy(bagofgold);
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
}
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginDisable(PluginDisableEvent event) {
if (event.getPlugin().getDescription().getName().equals("BagOfGold")) {
if (economy != null && economy.economy != null) {
economy.economy = null;
log.info(String.format("[%s][Economy] %s unhooked.", plugin.getDescription().getName(),
economy.name));
}
}
}
}
}